Skip to main content

SOAP Message Logging in Metro and WCF

Posted by arungupta on August 1, 2007 at 11:13 AM PDT

Metro provides Secure, Reliable,
Transactional and .NET 3.0 interoperable Web services stack in
GlassFish. This entry explains how to
enable SOAP message logging in Metro and .NET 3.0.

The SOAP message logging in Metro is explained

here
.

In WCF (the Web services stack in .NET), the
Configuration
Editor Tool
is the

preferred way
to enable SOAP message logging. But sometimes you may want to
directly edit your configuration file, for example, if you do not want to
re-generate the file again. In such cases you can include the XML fragments from
the template configuration file given below into your application specific
configuration and this will enable only SOAP message logging:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel.MessageLogging" switchValue="Warning, ActivityTracing">
        <listeners>
          <add type="System.Diagnostics.DefaultTraceListener" name="Default">
            <filter type="" />
          </add>
          <add name="ServiceModelMessageLoggingListener">
            <filter type="" />
          </add>
        </listeners>
      </source>
    </sources>
    <sharedListeners>
      <add initializeData="LOG_DIRECTORY\messages.svclog"
           type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
           name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>
  <system.serviceModel>
    <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true" logMessagesAtTransportLevel="true" />
    </diagnostics>
  </system.serviceModel>
</configuration>

After the client application is invoked, all SOAP messages will be logged to
LOG_DIRECTORY\messages.svclog file. The message log can be viewed
using
svctraceviewer
.

Technorati: wcf
webservices
wsit
projectmetro
glassfish

Related Topics >>