Java Reference
In-Depth Information
Monitoring SOAP Traffic with TCPMon
Problem
You want to monitor SOAP traffic without putting anything on your classpath.
Solution
Use TCPMon, an open source monitor for TCP traffic, available from ht-
tps://tcpmon.dev.java.net . You'll need to change the values in your local WSDL to use it.
Discussion
You can run the tool a few ways—directly from the Web using Java Web Start, or by down-
loading the JAR. It will listen on an available port, and you must route requests through it for
it to be able to dump the traffic data. TCPMon will then forward the requests on to the actual
destination.
Running TCPMon
The easiest way to get started with TCPMon is to visit the website and find the link that says
“Click here to run directly from the web.” If you don't want to do that, you can download it
and execute it on Windows by double-clicking it or on Linux by typing this command:
$ java -jar tcpmon.jar
This will start up the Java Web Start program. Here are the steps to get it up and running.
You'll use a NetBeans sample project because it gets in the way the least. If you have another
web service and client you want to use, the general instructions are still relevant:
1. Start the application. In the GUI, change the default values to the following:
▪ Local Port: 8090
▪ Server Port: 8080
2. Click “Add Monitor,” which will run the listener.
3. You want to send a SOAP request to port 8080 because that's the port your service is
listening on. So you need to change your WSDL to point to 8090 so that TCPMon can
dump the message. Then the value you supplied in the Server Port field is the target to
which TCPMon will forward each request. Because all you care about here is illustrating
the traffic dump, and not the service itself, you'll just create a new web service sample
Search WWH ::




Custom Search