Walkthrough: AWS: Java Code Sample: Extra

Step: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | N

It's often instructive to see the actual XML passed from your client and returned from the server. Axis comes with a TCP monitor tool (tcpmon), which allows you to intercept the traffic between the client and the server, in either direction (request or response). To start the monitor tool, make sure your CLASSPATH is set as in Step 3. Now type this:

% java org.apache.axis.utils.tcpmon 2021 soap.amazon.com 80

The CLASSPATH must be set as from Step 3. tcpmon looks like this:

Figure 4: tcpmon.

Instructions on how to use tcpmon are in the Axis User's Guide. The key change is to point the host field in the Java application from soap.amazon.com or xml.amazon.com to localhost. Then tack on the port (in the above figure, I used port 2021 for tcpmon). See the next figure:

Figure 5: The client window.

The change to the application causes its messages to get sent to tcpmon, which then displays the message, then forwards it to Amazon. tcpmon then receives the response from Amazon, displays it, then forwards it back to the sample application.

Note: A few days after I posted this information, Thunder Parley sent me e-mail recommending Ethereal over tcpmon. He said that Ethereal is a better protocol analyzer for SOAP messages. Give it a try!


Were these pages helpful? Any other feedback?

Let me know!

Step: 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | N


Rick (rgu@TheWorld.com) Umali
Original: 2/24/2004
Last Update: 3/4/2004