File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Web Services and the fly likes Sniffing SOAP messages from OTHER servers Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » Web Services
Bookmark "Sniffing SOAP messages from OTHER servers" Watch "Sniffing SOAP messages from OTHER servers" New topic

Sniffing SOAP messages from OTHER servers

Ben Ethridge
Ranch Hand

Joined: Jul 28, 2003
Posts: 108
Hi, everyone.

I've used tcpmon to monitor soap messages from my client to my own axis/tomcat server, but now I need to monitor messages from my client to other external web services, i.e. web services at, say or, etc.

I've used the CommView packet sniffer and that works, but it seems like shooting rabbits with an elephant gun, i.e. it's more than I really need...and it isn't cheap.

Can I use tcpmon or some other simple, free utility to see the soap request I'm sending out, and the soap response returned by the external web service?

I've googled this and read over the FAQ, but I can't seem to find the key to setting this up yet.

Peer Reynders

Joined: Aug 19, 2005
Posts: 2933
Originally posted by Ben Ethridge:
Can I use tcpmon...

Having used tcpmon only once before I might be missing something - but can't you just give tcpmon the real server (target) port/host-address and then have your client send its request to the fake localhost port that tcpmon is listening to (i.e. tcpmon is running on the same machine as the client)? That's how I would interpret the Admin tab of the tcpmon tool Appendix: Using TCPMon

In any case if you are using JAX-RPC on the client side you do have the option writing a logging SOAP handler and configure it in the client's handler chain so that all outgoing requests and incoming responses are logged - it's the same idea as the Axis SOAP monitor only in your case you want to install it on the client side.
Example: Logging soap messages on the client side
[ March 16, 2006: Message edited by: Peer Reynders ]
Ulf Dittmer

Joined: Mar 22, 2005
Posts: 42965
I think that should work, if the clients can be configured to access a specific port on your machine instead of some port on the actual target server.

TCPMon can be configured to listen on several ports, and to forward each port it listens to to a specific port on some specific server. So if the clients can reach any port on your machine, you can forward that to any port on any server. Not all clients have their target port and server easily configurable, though.
Ben Ethridge
Ranch Hand

Joined: Jul 28, 2003
Posts: 108
Hi. Thanks for the info.

I had read that Axis appendix, but it only discussed using localhost. I had tinkered with trying to put the remote server (and guessed the port was 80), but it didn't see any messages, when I sent/received them.

Can someone perhaps show a simple example of how to do this using tcpmon to some existing remote server, at, say sun or microsoft?

I agree. Here's the link:
subject: Sniffing SOAP messages from OTHER servers
jQuery in Action, 3rd edition