«^»
8.2. Using tcpmon to monitor the request and the response

We can have a clearer idea of what information is being transferred if we run the tcpmon program (that comes with Axis). Instead of the client program contacting the Web Service directly we arrange for it to go through the tcpmon program. So the client program contacts tcpmon and tcpmon contacts the Web Service.

We need to make a few changes for this to occur. First, modify the WSDL file so that the URL of the Web Service refers to a port on the local computer. For example, the three occurrences of:

<http:address location="http://www.winisp.net/cheeso/zips/ZipService.asmx" />
in the file ZipService.wsdl could be changed to:
<http:address location="http://localhost:8081/cheeso/zips/ZipService.asmx" />
where 8081 is an arbitrarily chosen port. Then run the WSDL2Java program again in order to generate new proxy classes. Now, when you want to run MyTestClient, first type the following command in a Command Prompt window:
start java org.apache.axis.utils.tcpmon 8081 www.winisp.net 80
As tcpmon is a part of Axis, it requires the very long classpath given earlier. Then, after the tcpmon window appears, type the following command in a Command Prompt window:
java MyTestClient 94042
The tcpmon window should show you the HTTP request that goes to www.winisp.net and the HTTP response that comes back from that site.