String convertSoapMessageAsString ( SOAPMessage soapMessage ) { if ( soapMessage == null ) { return "null" ; } try { ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; soapMessage . writeTo ( os ) ; return new String ( os . toByteArray ( ) , determineMessageEncoding ( soapMessage ) ) ; } catch ( Exception e ) { logger . error ( "Couldn't create string representation of soapMessage: " + soapMessage . toString ( ) ) ; return "ERROR" ; } }
Converts a SOAPMessage instance to string representation .