I am learning how to create Logical Handlers in JAX-WS SOAP web services. Here I am trying to get the payload data and want to print that for testing. But I am getting issue
Source payload = message.getPayload();
then convert the DomSource object to string by using xmltransformation or some other way , it will give you the payload.
As @curious said, use
Source payload = message.getPayload();
Sample code for convert the DomSource object to string by using xmltransformation is like this :
StringWriter sw = new StringWriter();
Transformer transformer = TransformerFactory.newInstance().newTransformer();
Result output = new StreamResult( sw );
transformer.transform( payload, output );
System.out.println("Response : "+sw.toString());