all groups > dotnet web services > june 2004 >
You're in the

dotnet web services

group:

Managing exceptions in web services (showing errors)


Managing exceptions in web services (showing errors) Diego F.
6/30/2004 7:55:57 PM
dotnet web services:
I use to show the error messages that I get in a try block.

try
{
...
}
catch (Exception ex)
{
... (ex.Message);
}

In a Windows App I use: Message.Show(ex.Message);

As the web service can be used in Windows apps or ASP.NET apps, what is the
way to do that?

Regards,

Diego F.

Re: Managing exceptions in web services (showing errors) Jan Tielens
7/1/2004 10:00:16 AM
You may want to read following article:
http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/soapexceptions.mspx
Throwing SoapExceptions
Summary:

Sometimes things can go wrong when code is executed, so Exceptions are
thrown. When your application exposes services through a webservice layer,
SoapExceptions are thrown from the server to the client. By default normal
Exceptions are converted to a SoapException, resulting in a rather ugly
Exception containing all information concatenated in a long String. But
luckily the SOAP protocol allows any XML document to be included in SOAP
error messages. This article shows how to build some helper classes to
easily pass error information from the server to the client through a
webservice layer.

--
Greetz
Jan
________________
Read my weblog: http://weblogs.asp.net/jan


"Diego F." <diegofr@NOterra.es> schreef in bericht
news:u43%23YusXEHA.2844@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button