You could try in this way.
SOAPMessage msg = messageContext.getMessage();
ByteArrayOutputStream out = new ByteArrayOutputStream();
msg.writeTo(out);
String strMsg = new String(out.toByteArray());
More Related Contents:
- How to do a SOAP Web Service call from Java class?
- How do I set the timeout for a JAX-WS webservice client?
- User authentication in SOAP Webservices
- How can I use an HTTP proxy for a JAX-WS request without setting a system-wide property?
- How to Send SOAPMessage into JMS [closed]
- How to call a SOAP web service on Android [closed]
- Working Soap client example
- Tracing XML request/responses with JAX-WS
- How to programmatically set the SSLContext of a JAX-WS client?
- SOAP request to WebService with java
- SSLHandshakeException: No subject alternative names present
- Unable to create JAXBContext creating my wsdl
- JAX-WS client : what’s the correct path to access the local WSDL?
- java: Rpc/encoded wsdls are not supported in JAXWS 2.0
- JAX-WS = When Apache CXF is installed it “steals” default JDK JAX-WS implementation, how to solve?
- JAX-WS – Map Exceptions to faults
- How to send a SOAP request using WebServiceTemplate?
- Parsing ksoap2 response
- Java Web Service client basic authentication
- overriding or setting web service endpoint at runtime for code generated with wsimport
- How to make generated classes contain Javadoc from XML Schema documentation
- Tracing XML request/responses with JAX-WS when error occurs
- RESTful webservice : how to set headers in java to accept XMLHttpRequest allowed by Access-Control-Allow-Origin
- JAXB unmarshall with namespaces and prefix
- How can I access the ServletContext from within a JAX-WS web service?
- JAX-WS vs. JAX-RPC
- Publishing a WS with Jax-WS Endpoint
- Singleton Object in Java Web service
- Could not handle mustUnderstand headers: {http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd}Security. Returning fault
- Main differences between SOAP and RESTful web services in Java [duplicate]