How do you print a SOAP response? I have been trying to do the following but its not printing the actual soap message. Its just giving me some sort of description.
Thanks for the quick response. The problem I was having using the WriteTo method is I need to store the SOAP message in a string to output to a JTextArea. Is there an easy way to do this? Sorry I am still new to java.
There are two ways:
- You can either call the getSOAPBody() and getSOAPHeader() methods and manually construct the entire pretty-printed SOAP message
- Use the ByteArrayOutputStream class instance and pass it to the writeTo() method. Retrieve the resulting string using the getString() method or use new String(outputStream.getBytes(), "UTF-8") in case you are using a specific encoding.
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.