Enabling Tracing in ASP.NET Web Services

December 16, 2011 § Leave a comment

This topic is specific to a legacy technology. XML Web services and XML Web service clients should now be created using Windows Communication Foundation .

 

This topic describes how to enable tracing in Web services built with ASP.NET in .NET Framework version 3.5. Enable tracing to identify how to increase performance and stability as well as increasing the ability to troubleshoot Web service issues.

Tracing for ASMX

To enable tracing for ASMX, use the following sample configuration.

Bb885203.note(en-us,VS.100).gifNote:
Tracing is only enabled when the application is fully trusted.

 

 

 

 
 
<system.diagnostics>
    <trace autoflush="true" />
    <sources>
        <source name="System.Web.Services.Asmx">
            <listeners>
                <add name="AsmxTraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="local.log" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId" />
            </listeners>
        </source>
    </sources>
    <switches>
        <add name="System.Web.Services.Asmx" value="Verbose"  />
    </switches>
</system.diagnostics>

Trace Level

All traces (except exceptions and serializations errors) use Information level. The exception traces uses Warning level for exceptions that are handled, and Error level for others. If the Trace level is Verbose, the exception stack is also traced, otherwise, only the exception type, the message and the code method where it was caught are traced. For serialization and deserialization errors, if tracing is enabled, serialization events are used to track the unknown elements and attributes in the SOAP message.

Trace Points

On the client side, the trace points are the followings,

  • Before and after Request Serialization
  • Before and after GetWebResponse
  • Before and after Response Deserialization
  • Before and after XmlSerializer Creation

On the server side, the trace points are the followings,

  • When the IIS Handler is called
  • Before and after Request Deserialization
  • Before Dispatching
  • When the server method returns
  • Before and after Serialization of response
  • Before and after XmlSerializer Creation

 

(Source : MSDN)

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

What’s this?

You are currently reading Enabling Tracing in ASP.NET Web Services at Naik Vinay.

meta

%d bloggers like this: