title: How to log the received SOAP message in Spring Integration
body: <p>I have a Web Service based inbound Messaging Gateway configured. I'd like to log the incoming SOAP messages (envelope and all inside it). What would be the best way to do that?</p>
  
  <p>I have tried using a wire tap with logging channel adapter, but don't know a good expression value for it to get the actual SOAP XML out. If the inbound gateway is configured not to extract payload, I will see SaajSoapMessage as payload and DOMSource otherwise. Is there an expression to get the SaajSoapMessage as XML String?</p>
  
  <p>Here's my configuration with which I get to see the toString() of SaajSoapMessage:</p>
  
  <pre><code>&lt;int:channel id="request"&gt;
      &lt;int:interceptors&gt;
          &lt;int:wire-tap channel="logger"/&gt;
      &lt;/int:interceptors&gt;
  &lt;/int:channel&gt;
  &lt;int:logging-channel-adapter id="logger" expression="payload" level="DEBUG"/&gt;
  
  &lt;int:channel id="reply"/&gt;
  &lt;int-ws:inbound-gateway id="ws-inbound-gateway" request-channel="request" reply-channel="reply"
                          extract-payload="false"/&gt;
  </code></pre>