Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 19th, 2008, 04:39 AM
Authorized User
 
Join Date: May 2008
Location: , , India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default error handling

Hi experts,

how to handle errors in webservices with out using soap.i need to pause the error info to developer.means..if there is any exception at runtime..i need to mail the error details to developer.

how can i achieve this??

Plz help me..its vvv urgent..

Thanx in Adv.

 
Old May 19th, 2008, 04:56 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Well you can add a Global.asax file to the web site and handle the Application_Error event.

Or you can add a try/catch around the code you think might error and do the emailing in the catch part.

/- Sam Judson : Wrox Technical Editor -/
 
Old May 19th, 2008, 05:52 AM
Authorized User
 
Join Date: May 2008
Location: , , India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You mr.Samjudson for helping me.
But how can i write code to achieve this.
means..am i need to create a class file and in that i have to write function for mailing and i have to call this function in webmethod???

 
Old May 19th, 2008, 06:35 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Do a search for "Global.asax error handling mail" should provide you with enough sample code to get you going.

/- Sam Judson : Wrox Technical Editor -/
 
Old May 19th, 2008, 06:49 AM
Authorized User
 
Join Date: May 2008
Location: , , India.
Posts: 12
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Thank You...
but i am going with Try-Catch block.
so how can i?

 
Old May 19th, 2008, 07:27 AM
samjudson's Avatar
Friend of Wrox
Points: 8,687, Level: 40
Points: 8,687, Level: 40 Points: 8,687, Level: 40 Points: 8,687, Level: 40
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Aug 2007
Location: Newcastle, , United Kingdom.
Posts: 2,128
Thanks: 1
Thanked 189 Times in 188 Posts
Default

Code:
try
{
  // You code here
}
catch(Exception ex)
{
  // Send mail in here.
}
/- Sam Judson : Wrox Technical Editor -/




Similar Threads
Thread Thread Starter Forum Replies Last Post
error handling Abhinav_jain_mca General .NET 5 December 21st, 2005 01:12 AM
Error Handling twbit BOOK: ASP.NET Website Programming Problem-Design-Solution 1 May 3rd, 2005 09:18 PM
Error handling Hudson40 Access VBA 2 February 11th, 2005 05:32 AM
Error Handling zaeem Classic ASP Basics 2 November 14th, 2003 10:42 AM
Error handling ! ittorget Classic ASP Professional 2 November 14th, 2003 09:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.