title: How to verify digital signature of SOAP call?
body: <p>I wrote an interceptor in Apache CXF and get a SoapMessage. How do I get the raw XML from the SOAP message without changing the data to hurt the verification of the digital signature?</p>
  
  <p>I refer to org.apache.cxf.binding.soap.SoapMessage:</p>
  
  <pre><code>import org.apache.cxf.binding.soap.SoapMessage;
  import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor;
  import org.apache.cxf.binding.soap.interceptor.EndpointSelectionInterceptor;
  import org.apache.cxf.binding.soap.interceptor.ReadHeadersInterceptor;
  import org.apache.cxf.interceptor.Fault;
  import org.apache.cxf.phase.Phase;
  import org.apache.logging.log4j.LogManager;
  import org.apache.logging.log4j.Logger;
  public class XmlSignatureVerifyInInterceptor extends AbstractSoapInterceptor {
  
      private static final Logger log = LogManager.getLogger(XmlSignatureVerifyInInterceptor.class);
  
      public XmlSignatureVerifyInInterceptor() {
          super(Phase.READ);
          log.entry();
          addAfter(ReadHeadersInterceptor.class.getName());
          addAfter(EndpointSelectionInterceptor.class.getName());
      }
  
      @Override
      public void handleMessage(SoapMessage soapMessage) throws Fault {
          log.entry(soapMessage);
      }
  
  }
  </code></pre>
  
  <p>Cheers and thank you in advance!</p>
  
  <p>Fireball</p>