This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
The moose likes Web Services and the fly likes Print out the SOAP request Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Print out the SOAP request" Watch "Print out the SOAP request" New topic
Author

Print out the SOAP request

Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
How can I print out the SOAP request to see how the SOAP Envelope looks like?


[ June 06, 2006: Message edited by: Jeppe Fjord ]
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
It would be much less messy to use a tool like TCPMon to visualize the SOAP request and response. That's also part of the Axis download, and the documentation is here.


Ping & DNS - my free Android networking tools app
Jeppe Sommer
Ranch Hand

Joined: Jan 07, 2004
Posts: 270
Is that the only way to use a tool like "tcpmon" to see how the envelop looks like? I hope there was a certain method to print out what is sent to the webservice...
Masoud Kalali
Author
Ranch Hand

Joined: Jul 08, 2004
Posts: 531

you may use a message handler to print out the soap messages.
by using handlers you can intercept a message before going out or comming in.
for more information look at :
http://www-128.ibm.com/developerworks/webservices/library/ws-tipjax1.html


Masoud Kalali
Software Engineer - My Weblog - GlassFish Security
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
Here's a code snippet I used to print out a SOAP message.


[ June 07, 2006: Message edited by: Ulf Dittmer ]
Paul Celona
Greenhorn

Joined: May 20, 2004
Posts: 15
When implementing this code snippet in a web service msg handler, where does the println go to?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41634
    
  55
@Paul:

It uses standard out, so whereever that goes, the output will go. On the server it usually ends up in one of the log files, but that depends on which server is used.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Print out the SOAP request