How to solve issue SaajSoapMessageException: Could not write message to OutputStream

SaajSoapMessageException error

While implementing a SOAP client using Spring WS I’ve got the following error when I tried to write the content of the SOAP message to my logger:

org.springframework.ws.soap.saaj.SaajSoapMessageException: Could not write message to OutputStream: Error during saving a multipart message; nested exception is com.sun.xml.internal.messaging.saaj.SOAPExceptionImpl: Error during saving a multipart message
at org.springframework.ws.soap.saaj.SaajSoapMessage.writeTo(SaajSoapMessage.java:280)

Continue reading