title: How do I get the response payload of a REST service from the Message of an outgoing Interceptor?
body: <p>I have written a interceptor in the outgoing chain in the <code>SEND</code> phase and I want to get the payload of the response of my <strong>REST</strong> service into a String variable. How can I achieve this?</p>
  
  <p>Here is my interceptor</p>
  
  <pre><code>public class MyLoginOutInterceptor extends LoggingOutInterceptor {
  
      public MyLoginOutInterceptor() {
          super(Phase.SEND);
      }
  
      @Override
      public void handleMessage(Message message) throws Fault {
          OutputStream os = message.getContent(OutputStream.class);
      }
  }
  </code></pre>
  
  <p>When I put a breakpoint to the <code>OutputStream os = message.getContent(OutputStream.class);</code> I see that the payload is in the os but I don't know how to get it into a String. </p>
  
  <p>Any ideas?</p>