Share via


Web Services Enhancements Diagnostic Settings

WSE supports features to help diagnose what is causing the failure of an application that is using WSE. WSE diagnostic features include SOAP message tracing and the option to turn on detailed exception messages that WSE throws. Developers can trace SOAP messages sent to and received by WSE to a file. By default, WSE throws errors that give only a general idea of what caused the problem, in order to protect against hacker attacks. Turning on detailed exception messages makes it easier to pinpoint where a failure is occurring.

Tracing the SOAP messages sent to and/or received by a Web service or client application

  1. Add a <section> Element (WSE for Microsoft .NET) element to the <configuration> section for the Web.config file that affects the Web service. This adds the microsoft.web.services2 configuration section handler for this configuration file.
    The following code example shows how to add the microsoft.web.services2 configuration section handler.

    <configuration>
       <configSections>
          <section name="microsoft.web.services2"
                   type="Microsoft.Web.Services2.Configuration.WebServicesConfiguration, Microsoft.Web.Services2, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" />
       </configSections>
    </configuration>
    
  2. Add a <trace> Element (WSE for Microsoft .NET) element to the configuration file affecting the client application or Web service.
    For a Web service or a Web Forms client application, place the element in the Web.config file for the Web application hosting it. For a Windows Forms or console client application, place the element in the App.config file.
    The <trace> element has the attributes listed in the following table.

    Attribute Description Valid values

    Enabled

    (Required) Determines whether tracing is enabled.

    true if tracing is enabled; otherwise, false.

    Input

    (Optional) The file name used to trace SOAP messages received by the client application or Web service.

    A valid filename. The default is inputTrace.webinfo.

    Output

    (Optional) The file name used to trace SOAP messages sent to the client application or Web service.

    A valid filename. The default is outputTrace.webinfo.

Note

It is strongly recommended that the input and output trace files be stored in files with either a .config or a .webinfo extension. Failure to do so may allow users to retrieve the contents of the input and output trace files by navigating to the files from a Web browser.

Enabling an application to throw detailed WSE error messages

  • In the Web.config file for the Web service for which you want detailed SOAP fault messages, add a <customErrors> element and set the mode attribute to Off or RemoteOnly.
    The following example specifies that SOAP faults with detailed error messages be thrown to the SOAP message sender.

    <configuration>
       <system.web>
          <customErrors mode="Off" />
       </system.web>
    </configuration>
    

See Also

Concepts

Common Configuration Issues

Other Resources

Troubleshooting WSE Applications