Tuesday, January 09, 2007

SOAP Exception, with trace or without

When a Web service returns a SOAP Exception, you could decide on whether to pass on the trace or not.
If the web service consumer could be indicated with the trace, so as to help in fixing the problem then pass on the trace.
Or when business layer validations are thrown as exception all you need is "Server was unable to process --> User name is invalid", instead of the lengthy SOAP exception.
To enable exception, with trace, Web.config of web service, set the customErrors mode to "RemoteOnly" or "Off"
To disable trace in the exception, Web.config of web service, set the customErrors mode to "On"

Cheers