How to return a custom defined soap error message

M

Mullin Yu

if the web services has a run-time error, how can i send a custom soap error
message, like embed the error stack trace:

try
{
.......
.......
}
catch(Exception ex)
{
// format the custom soap error message
msg = formatSOAPMsg(ex.ToString());
// send the soap error message
}
 
J

Jan Tielens

You may want to read following article:
http://tinyurl.com/25j4q
Throwing SoapExceptions

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
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top