title: CXF, out interceptor, alter response SOAP body
body: <p>Using CXF interceptor, I want to alter the response body which is being sent to the client as response. (I want to add some more nodes)
  My interceptor is configured as an outgoing interceptor, is being invoked but the body is empty.</p>
  
  <pre><code>public class AlterOutBodyInterceptor extends AbstractSoapInterceptor {
      private SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
  
      public AlterOutBodyInterceptor() {
          super(Phase.PRE_MARSHAL);
          getBefore().add(SAAJOutInterceptor.class.getName());
      }
  
      public void handleMessage(SoapMessage message) throws Fault {
          SOAPMessage doc = message.getContent(SOAPMessage.class);
          if (doc == null) {
              saajOut.handleMessage(message);
              doc = message.getContent(SOAPMessage.class);
              // it is executed
          }
  
          try {
              SOAPBody body = doc.getSOAPBody();
              // here, body doesn't contain anything that the client gets
          } catch (SOAPException e) {
              e.printStackTrace();
          }
      }
  }
  </code></pre>
  
  <p>I am doing trial-error with getBefore - getAfter and Phases, but without luck. Thanks in advance!</p>