Pretty Print SOAP Message and Display the SOAP message in HTML



In some situations it could be useful to pretty print a SOAP message to be able to show it in a html page.
Often applications that uses web services needs to log the SOAP messages that is sent to and from the services and then display them in some sort of administration application.
It would also perhaps be nice not to use the pre-tag but to embed the code along the rest of the html code.
In such a case the pretty print comes in handy. This example shows how to pretty print a SOAP message reading the unformatted envelope from a file, formats (pretty print) the message and writes it to a html file.

This is what the SOAP message looks like when it is pretty printed and displayed as html:







Search for more Java info on this site here:
Custom Search


Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">