title: Log SOAP Messages
body: <p>I created a class that intercepts the Request-Response cycle of SOAP message exchange and I wanted to log the exchange of messages.
  What's the best way so that I could log the SOAP message in my log file?</p>
  
  <p>I dont want it to be pretty printed in my log file but I just want to access
  and view the request and response SOAP envelope.</p>
  
  <p>I tried with this code:</p>
  
  <pre><code>public class LogHandler{    
      private static final Logger _LOG;
      @Override
      protected void handleResponse(SOAPMessage message)
          logSOAPMessage(message);
      }
      @Override
      protected void handleRequest(SOAPMessage message)
          logSOAPMessage(message);
      }    
      private void logSOAPMessage(SOAPMessage message){
        _LOG.info(":: Logging SOAP Message :: " + message.toString());
      }
  }
  </code></pre>
  
  <p>But doesnt get the required message.</p>
  
  <pre><code>:: Logging SOAP Message :: oracle.j2ee.ws.saaj.soap.soap11.Message11@715346
  </code></pre>
  
  <p>Any hints?</p>