Logging long SOAP messages without CPU and memory hog
currently I log WS SOAP traffic with Service.setHandlerResolver(). Unfortunately it seems that SOAPMessageContext.getMessage() parses the message to DOM like structure (SAX2DOME) and that structure is then serialized to String with SOAPMessage.writeTo(ByteArrayOutputStream). Both the operations are CPU and memory intensive for long SOAP messages. How can I get the raw message bytes (as they appear in HTTP) and log them without the unnecessary back and forth transformations? The memory needed for DOM seems to be 10-20x the actual message size and my SOAPs are ~6M bytes.