Share via


<trace> Element (WSE for Microsoft .NET)

Specifies whether SOAP messages are traced and if so where to write the trace.

<microsoft.web.services2> Element
  <diagnostics> Element

<trace enabled="true|false" 
       input="File name to write trace of incoming SOAP messages."
       output="File name to write trace of sent SOAP messages."/>

Attributes and Elements

Attributes

Attribute Description

enabled

Required attribute. Specifies whether tracing is enabled. The default value is false.

input

Optional attribute. Specifies the file in which to trace incoming SOAP messages. The default value is inputTrace.webinfo.

output

Optional attribute. Specifies the file in which to trace sent SOAP messages. The default value is outputTrace.webinfo.

Child Elements

None.

Parent Elements

Element Description

<diagnostics> Element

Controls the diagnostics settings for the Microsoft Web Services Enhancements.

Remarks

Before adding the <trace> element to a configuration file, you must add the microsoft.web.services2 configuration section handler to the configuration file. For details about adding the microsoft.web.services2 configuration section handler, see <section> Element (WSE for Microsoft .NET).

When the file name specified in an input or output attribute does not contain a path, the file is written to the folder containing the configuration file.

When enabling tracing for an Web service, it is recommended that the file name have an extension of .webinfo or .config. By default, users cannot request files with these extensions using a Web browser.

Tracing can be turned on for both Web services and client applications.

Note

When you turn on tracing, the <Body> element of the SOAP message is saved into the file in plain text. You should be aware of the potential privacy issues associated with storing the contents of the <Body> element in plain text, especially when a user's private data is transmitted in the <Body> element. Given the potential sensitivity of the information stored in the tracing file, appropriate measures must be taken to ensure that only your designated users have access to the tracing file.

Note

Whether tracing is turned on for a Web service or a client application, the identity of the process executing the trace must have full control access to the input and output trace files. For example, if tracing is turned on for a Web service, the process identity for the ASP.NET worker process, which is ASPNET by default, must have full control access to the input and output trace files.

Note

Once an application is deployed to production, tracing should not be enabled. Doing so, may eventually deplete the available disk space on the computer running the application.

To give an account full control access to a trace file

  1. Open Windows Explorer.
  2. Navigate to the folder containing the trace file..
  3. Select the trace file.
  4. From the File menu, select Properties.
  5. On the Security tab, add the account and select the Full Control option.

Example

The following code example specifies that tracing is enabled and specifies the files that the trace is written to for incoming and sent SOAP messages.

<configuration>
  <microsoft.web.services2>
    <diagnostics> 
      <trace enabled="true" 
        input="inputTrace.webinfo" 
        output="outputTrace.webinfo"/>
    </diagnostics>
  </microsoft.web.services2>
</configuration>

See Also

Reference

<diagnostics> Element
<policyTrace> Element