Exception handling question

M

Michel

Hi there,

I have an ASP.NET web site and service. The site calls methods from the
web-service.
Whenever a service call throws an exception, I'd like to get the exception
message.
However, at the client, the message contains the class name and stack trace
of the exception, and is encapsulated in a SoapException message, e.g.

....SoapException: ....MyException: The Actual Message at \n stack trace

The InnerException property is always null (even when throwing a
SoapException with embedded exception at the service).

How do I get to the exception message?

Any help appreciated,
Thanks,
Michel
 
J

Jan Tielens

Check out following article that handles this problem:
http://www.microsoft.com/belux/nl/msdn/community/columns/jtielens/soapexcept
ions.mspx

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 Tielens
________________________________
Read my weblog: http://weblogs.asp.net/jan
 
M

Michel

Hi Jan (ook Hollandse kaasboer toevallig),

I've briefly read the article and related articles.
This is what I need.

Thanks a lot,
Michel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top