How to format a generic soap error message

  • Thread starter Thread starter Mullin Yu
  • Start date Start date
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
}
 
Hi Mullin,

You may like to try the SoapException class.
(System.Web.Services.Protocols.SoapException)
The documentation contains an example of its usage.
It wraps exceptions thrown from the web service into a SOAP fault that
is propagated to the client/consumer of the webservice.

Regards,
Aravind C
 
Back
Top