title: WCF service client: How do I debug the response parsing
body: <p>I am building a web service client to interact with a (java-based) remote web service, out of my control.  I can call the web service operation, and can tell by packet-sniffing that the service is responding with populated data.  However, by the time that response makes it into the client code, the response is only a shell, with all the data null.  </p>
  
  <p>I suspect that an error is occurring in the web service "plumbing" that is causing the data to be silently dropped or ignored, but I can't find a way to enable debugging (or even logs or error messages?) during the receipt of the response before it hits my client code.  </p>
  
  <p>My App.config has Message Logging enabled, but only outgoing messages are being logged:</p>
  
  <pre><code>&lt;system.diagnostics&gt;
      &lt;sources&gt;
          &lt;source name="System.ServiceModel.MessageLogging"&gt;
              &lt;listeners&gt;
                  &lt;add name="messages"
                  type="System.Diagnostics.XmlWriterTraceListener"  
                  initializeData="c:\messages.svclog" /&gt;
              &lt;/listeners&gt;
          &lt;/source&gt;
      &lt;/sources&gt;
  &lt;/system.diagnostics&gt;
  
  &lt;system.serviceModel&gt;
      &lt;diagnostics&gt;
          &lt;messageLogging
               logEntireMessage="true"
               logMalformedMessages="true"
               logMessagesAtServiceLevel="true"
               logMessagesAtTransportLevel="true"
               maxMessagesToLog="3000"
               maxSizeOfMessageToLog="2000"/&gt;
      &lt;/diagnostics&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I really want to set a breakpoint during the actual parsing of the response message, but having the Message Logger actually log the response may also help a bit.</p>
  
  <p>I've also configured a custom <code>MessageEncoder</code> which was necessary to work around a bug in the remote service's parser.  I can add breakpoints to the <code>ReadMessage</code> methods on that <code>MessageEncoder</code>, and can see that the data is still there at that point.  However, the next step jumps back into the client code, and the Response object is empty -- no warnings or messages.  Is there any way to see what's going on in between?</p>
  
  <p>So, I guess this ends up being a two-part question:</p>
  
  <ol>
  <li>How/Where can I set a breakpoint to observe the SOAP message getting
  processed, after the <code>MessageEncoder</code>, but before it is sent to the client code? </li>
  <li>What's wrong with my logging config that only outgoing
  messages are logged?</li>
  </ol>