title: Intercept RequestSecurityTokenResponse with SOAPHandler
body: <p>I'm using apache CXF to process soap messages. I need to handle RequestSecurityTokenResponse to take an Identifier associated with MessageID from RequestSecurityToken (request). I've added SOAPHandler as follows:</p>
  
  <pre><code>&lt;camel-cxf:cxfEndpoint id="serviceEndpoint"
                  address="..."
                  serviceClass="..."
                  wsdlURL="..."
                  endpointName="..."
                  serviceName="..."
                  xmlns:s="..."&gt;
      &lt;camel-cxf:properties&gt;
          &lt;entry key="ws-security.callback-handler" value-ref="keystorePasswordCallbackHandler" /&gt;
          &lt;entry key="security.sts.token.do.cancel" value="true" /&gt;
      &lt;/camel-cxf:properties&gt;
      &lt;camel-cxf:handlers&gt;
          &lt;bean class="ws.MySoapHandler" /&gt;
      &lt;/camel-cxf:handlers&gt;
  &lt;/camel-cxf:cxfEndpoint&gt;
  </code></pre>
  
  <p>where MySoapHandler logs inbound/outbound messages:</p>
  
  <pre><code>public class MySoapHandler implements SOAPHandler&lt;SOAPMessageContext&gt; {
  
      private static final Logger log = LoggerFactory.getLogger(LoggingHandler.class);
  
      @Override
      public Set&lt;QName&gt; getHeaders() {
          return new HashSet&lt;&gt;();
      }
  
      @Override
      public boolean handleMessage(SOAPMessageContext context) {
          Boolean isOutBound = (Boolean) context.get(MessageContext.MESSAGE_OUTBOUND_PROPERTY);
          try {
              if (isOutBound){
                  log.info("############# Intercepting outbound message #############");
              } else {
                  log.info("############# Intercepting inbound message #############");
              }
              ByteArrayOutputStream baos = new ByteArrayOutputStream();
              context.getMessage().writeTo(baos);
              log.info(baos.toString());
          } catch (SOAPException e) {
              e.printStackTrace();
          } catch (IOException e) {
              e.printStackTrace();
          }
          return true;
      }
  
      @Override
      public boolean handleFault(SOAPMessageContext context) {
          return false;
      }
  
      @Override
      public void close(MessageContext context) {
          System.out.println("Do some cleanup handling .. ");
      }
  }
  </code></pre>
  
  <p>When I check logs, I don't see  RequestSecurityTokenResponse message.
  Can you tell me why? Is it possible to handle RequestSecurityTokenResponse</p>