Friday, July 6, 2007

Using the ThrowDetailedError switch

If an error occurs, the Web client receives a generic SoapException.

To debug your published Web service, you can add a switch to the web.config file to control the level of the exception details returned from the published Web service. The switch is ThrowDetailedError, and when it is set to True the server proxy returns inner exception information to the Web client, enabling you to debug the published Web service.

The following XML code shows the ThrowDetailedError switch that appears in the web.config file under the appSettings node:


<appsettings>
<add key="ThrowDetailedError" value="False">
<appsettings>

Warning

The inner exception may contain sensitive information. After debugging, you should set the ThrowDetailedError switch to False.

Source: Microsoft

No comments: