if (!message.containsKey(SAAJOutInterceptor.ORIGINAL_XML_WRITER)) {
XMLStreamWriter origWriter = message.getContent(XMLStreamWriter.class);
message.put(SAAJOutInterceptor.ORIGINAL_XML_WRITER, origWriter);
}
W3CDOMStreamWriter writer = new OverlayW3CDOMStreamWriter(soapMessage.getSOAPPart());
// Replace stax writer with DomStreamWriter
message.setContent(XMLStreamWriter.class, writer);
message.setContent(SOAPMessage.class, soapMessage);
BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);