tags:

views:

476

answers:

1

This question seems to be pretty close to what I am looking for - I was able to setup tracing and I am looking at the log entries for my calls to the service.

However I need to see the raw soap request with the data I am sending to the service and I see no way of doing that from the SvcTraceViewer (only log entries are shown but no data sent to the service) - am I just missing configuration?

Here's what I got in my web.config:

  <system.diagnostics>
    <sources>
      <source name="System.ServiceModel"
              switchValue="Verbose"
              propagateActivity="true">
        <listeners>
          <add name="sdt"
              type="System.Diagnostics.XmlWriterTraceListener"
              initializeData="App_Data/Logs/WCFTrace.svclog"  />
        </listeners>
      </source>
    </sources>
  </system.diagnostics>

Any help appreciated!

UPDATE: this is all I see in my trace:

<E2ETraceEvent xmlns="http://schemas.microsoft.com/2004/06/E2ETraceEvent"&gt;
  <System xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"&gt;
    <EventID>262163</EventID>
    <Type>3</Type>
    <SubType Name="Information">0</SubType>
    <Level>8</Level>
    <TimeCreated SystemTime="2010-05-10T13:10:46.6713553Z" />
    <Source Name="System.ServiceModel" />
    <Correlation ActivityID="{00000000-0000-0000-1501-0080000000f6}" />
    <Execution ProcessName="w3wp" ProcessID="3492" ThreadID="23" />
    <Channel />
    <Computer>MY_COMPUTER_NAME</Computer>
  </System>
<ApplicationData>
  <TraceData>
    <DataItem>
      <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Information">
        <TraceIdentifier>http://msdn.microsoft.com/en-US/library/System.ServiceModel.Channels.MessageSent.aspx&lt;/TraceIdentifier&gt;
          <Description>Sent a message over a channel.</Description>
            <AppDomain>MY_DOMAIN</AppDomain>
            <Source>System.ServiceModel.Channels.HttpOutput+WebRequestHttpOutput/50416815</Source>
            <ExtendedData xmlns="http://schemas.microsoft.com/2006/08/ServiceModel/MessageTraceRecord"&gt;
            <MessageProperties>
              <Encoder>text/xml; charset=utf-8</Encoder>
              <AllowOutputBatching>False</AllowOutputBatching>
              <Via>http://xxx.xx.xxx.xxx:9080/MyWebService/myService&lt;/Via&gt;
            </MessageProperties>
          <MessageHeaders></MessageHeaders>
        </ExtendedData>
      </TraceRecord>
    </DataItem>
  </TraceData>
</ApplicationData>
+3  A: 

You don't have a specific tab that shows just the SOAP message - but the XML tab does include the whole SOAP message - no??

alt text

What is missing for you from this snippet of XML here??

UPDATE: John, you're unfortunately not showing what your <system.serviceModel>/<diagnostics> section looks like - mine used for this result looks like this:

<diagnostics>
  <messageLogging 
      logMessagesAtTransportLevel="true" 
      logMessagesAtServiceLevel="false"
      logMalformedMessages="true" 
      logEntireMessage="true"
      maxSizeOfMessageToLog="65535000" 
      maxMessagesToLog="500" />
</diagnostics>

Do you have the same settings? Maybe you're missing logEntireMessage or something else??

marc_s
tnx for helping - updated question to show what I see in the xml. There's no Envelope! Am I missing something from config?
JohnIdol
Also I seem to have a different version of svctraceviewer - the message tab next to the xml tab is not showing up
JohnIdol
@JohnIdol: which binding are you using??
marc_s
I was entirelty missing the messageLogging section! - do I need also need to use System.ServiceModel.MessageLogging or will the envelope show up even if I keep System.ServiceModel?
JohnIdol
@JOhnIdol: you need both the <system.serviceModel>/<diagnostics>.... stuff I posted (sets up what gets logged), as well as your stuff in <system.diagnostics> (defined *where* that stuff gets logged to)
marc_s
cool - but it doesn't seem to work with source --> name="System.ServiceModel" while it works with source --> name="System.ServiceModel.MessageLogging"
JohnIdol
the log doesn't seem to refresh nicely - I have to wait minutes before I can see the entries and getting loads of errors when opening. Is there some process I need to kill to get it to persist or some other tip you can share? :)
JohnIdol
@JohnIdol: not sure - I believe there are a couple of options you could set on the XmlWriterTraceListener to influence how and how quickly the file gets written / flushed to. Check out the MSDN docs for it! http://msdn.microsoft.com/en-us/library/system.diagnostics.xmlwritertracelistener.aspx
marc_s
this one did the trick --> <trace autoflush="true" /> :) - I am all set now thanks!
JohnIdol
@JohnIdol: great to hear ! I was just gonna recommend that one :-)
marc_s
Hey Marc - should I be able to see HttpHeaders as well from this log? I am having a problem where a service call is very slow through an HttpHandler and the only thing left to check are Http Headers --> http://stackoverflow.com/questions/2876955/service-call-very-slow-if-going-through-httphandler/2877038#2877038 - you might answer to the new question if you know! :)
JohnIdol