[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Cannot see SOAP body in message trace in WCF

Posted on 2011-10-13
1
Medium Priority
?
641 Views
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:
...
    <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.
0
Comment
Question by:shekhar_shashi
1 Comment
 
LVL 3

Accepted Solution

by:
shekhar_shashi earned 0 total points
ID: 36965245
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

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
Here I am going to explain creating proxies at runtime for WCF Service. So basically we use to generate proxies using Add Service Reference and then giving the Url of the WCF service then generate proxy files at client side. Ok, what if something ge…
Look below the covers at a subform control , and the form that is inside it. Explore properties and see how easy it is to aggregate, get statistics, and synchronize results for your data. A Microsoft Access subform is used to show relevant calcul…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month19 days, 13 hours left to enroll

872 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