cxf-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jay Prakash <>
Subject Unable to get SOAPBody in interceptor
Date Tue, 19 Aug 2014 22:00:08 GMT
       I've reading about CXF interceptor and I'm writing one currently
which will read parts of incoming SOAP request and log them (for now).

public class SampleInterceptor extends AbstractSoapInterceptor {

       public SampleInterceptor () {

public void handleMessage(final SoapMessage message) throws Fault {
                final SOAPMessage saaj =
final SOAPBody document;
try {
document = saaj.getSOAPPart().getEnvelope().getBody();
//document = saaj.getSOAPBody();
} catch (final SOAPException e) {
logger.error("", "Unable to get SOAP body from request", e);
throw new Fault(e);
                // log some nodes in the document.

Also I've added the SAAJ interceptor to the incoming interceptor chain at
the endpoint like this.

        <bean id="saajInInterceptor"
        <ref bean="sampleInterceptor"/>

The problem is that the document is coming out as null/empty (in both

[soapenv:Body: null]

In debug mode I see that SAAJInInterceptor was executed in PRE_PROTOCOL
phase and thus I am expecting a SAAJ model (also
message.getContentFormats() shows SOAPMessage in it).

I'm using CXF 2.7.1 and I'd appreciate any pointers on why this is showing
up as empty.

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message