Skip to main content

? How to print javax.xml.soap.SOAPElement ?

1 reply [Last post]
john7sp
Offline
Joined: 2008-09-18

hi
I am receiving an javax.xml.soap.SOAPElement from a webservice.
SOAPElement soapElement = port.findParty("35020722624");

I want to print the entire XML in the soapElement . how can i do that ?please let me know asap.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
pipkin
Offline
Joined: 2008-09-23

String serializeSOAPMessage(SOAPMessage msg) throws SOAPException, IOException {
ByteArrayOutputStream byteArrayOS = new ByteArrayOutputStream();
msg.writeTo(byteArrayOS);
return new String(byteArrayOS.toByteArray());
}