Cannot see SOAP body in message trace in WCF

Posted on 2011-10-13
Last Modified: 2012-05-12
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:
            <source name="System.ServiceModel.MessageLogging" switchValue="Verbose,ActivityTracing">
                    <add type="System.Diagnostics.DefaultTraceListener" name="Default">
                        <filter type="" />
                    <add name="ServiceModelMessageLoggingListener">
                        <filter type="" />
            <add initializeData="c:\gradschool\cis525\wcf\wcfdemo1\creditcardclient\app_messages.svclog"
                type="System.Diagnostics.XmlWriterTraceListener, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
                name="ServiceModelMessageLoggingListener" traceOutputOptions="Timestamp">
                <filter type="" />
      <messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true"
        logMessagesAtTransportLevel="true" />

My service app config file is:
      <add initializeData="c:\gradschool\cis525\wcf\wcfdemo1\creditcardvalidationservice\app_tracelog.svclog"
        type="System.Diagnostics.XmlWriterTraceListener, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089"
        name="ServiceModelTraceListener" traceOutputOptions="Timestamp">
        <filter type="" />
    <compilation debug="true" />
  <!-- 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. -->
      <messageLogging logMalformedMessages="false" logMessagesAtServiceLevel="false"
        logMessagesAtTransportLevel="false" />
The log files are generated by I do not see anything in the soap envolope.
It looks like:
<HttpRequest xmlns="">
<s:Envelope xmlns:s="">
<Action s:mustUnderstand="1" xmlns=""></Action>

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.
Question by:shekhar_shashi
    1 Comment
    LVL 3

    Accepted Solution

    This was a configuration setting problem. I set the logEntireMessage = true and the entire message (SOAP header and body) started logging.

          <messageLogging logEntireMessage="true" logMalformedMessages="true"
            logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    This tutorial will show you how to add an attribute to an XML ( stream returned from a Windows Communication Foundation ( (WCF) Web Service.  Some knowled…
    In previous Articles, we have discussed how we can upload a file using .asmx web service and isolated storage space. Here, in continuation to the topic, I am going to discuss how we can use WCF for the same purpose. Steps: 1.Create the silverli…
    This video is in connection to the article "The case of a missing mobile phone (". It will help one to understand clearly the steps to track a lost android phone.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now