Yes, there is. It is one of main purposes of JAX-WS handlers. You will not get XML payload as raw bytes, but formatted; however if you want it is easy to turn it into raw bytes again. An example:
public class MyCustomHandler implements SOAPHandler<SOAPMessageContext> {
@Override
public boolean handleMessage(SOAPMessageContext context) {
SOAPMessage msg = context.getMessage();
SOAPEnvelope env = msg.getSOAPPart().getEnvelope();
SOAPBody body = env.getBody();
// now when you have SOAP body you can do whatever you want...
return true;
}
}
You can also use this call:
JAXBContext jaxbContext = JAXBContext.newInstance(ObjectFactory.class);
Object payload = msg.getPayload(jaxbContext);
References: