Cannot see SOAP body in message trace in WCF

I have a simple "hello world" WCF service that uses basichttpbinding. The service takes a string input parameter and returns s string value. I enabled tracing on the service using the ECF configuration.
My client config file is:
...
    <system.diagnostics>
        <sources>
            <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
                <listeners>
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                        <filter type="" />
                    </add>
                    <add name="ServiceModelMessageLoggingListener">
                        <filter type="" />
                    </add>
                </listeners>
            </source>
        </sources>
        <sharedListeners>
            <add initializeData="c:\gradschool\cis525\wcf\wcfdemo1\creditcardclient\app_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 logMalformedMessages="true" logMessagesAtServiceLevel="true"
        logMessagesAtTransportLevel="true" />
    </diagnostics>
...

My service app config file is:
  <sharedListeners>
      <add initializeData="c:\gradschool\cis525\wcf\wcfdemo1\creditcardvalidationservice\app_tracelog.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
      </add>
    </sharedListeners>
  </system.diagnostics>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- When deploying the service library project, the content of the config file must be added to the host's
  app.config file. System.Configuration does not support config files for libraries. -->
  <system.serviceModel>
    <diagnostics>
      <messageLogging logMalformedMessages="false" logMessagesAtServiceLevel="false"
        logMessagesAtTransportLevel="false" />
    </diagnostics>
 
The log files are generated by I do not see anything in the soap envolope.
It looks like:
<MessageLogTraceRecord>
<HttpRequest xmlns="http://schemas.microsoft.com/2004/06/ServiceModel/Management/MessageTrace">
<Method>POST</Method>
<QueryString></QueryString>
<WebHeaders>
<VsDebuggerCausalityData>uIDPo6g1oCSJeLBFiAB0npAHr0YAAAAAOtW+JuWoxkS9jvdMJnRohBYblxy3thlOhzGlJQbYqqcACQAA</VsDebuggerCausalityData>
</WebHeaders>
</HttpRequest>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
<s:Header>
<Action s:mustUnderstand="1" xmlns="http://schemas.microsoft.com/ws/2005/05/addressing/none">http://tempuri.org/ICreditcardValidationService/ValidateCreditCard</Action>
</s:Header>
</s:Envelope>
</MessageLogTraceRecord>
...

The parameter values are passed and processed correctly by the service.

I am not sure what I am doing wrong. How do I get the passed parameters to show in the soap body?

I am using VS 2010 and .Net 4.0 framework.

Please help.
LVL 3
shekhar_shashiAsked:
Who is Participating?
 
shekhar_shashiAuthor Commented:
This was a configuration setting problem. I set the logEntireMessage = true and the entire message (SOAP header and body) started logging.

   <diagnostics>
      <messageLogging logEntireMessage="true" logMalformedMessages="true"
        logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
    </diagnostics>
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.