When a WEB service client makes a call to the server, both the request and the response use SOAP packets for communication. During development and testing, the contents of the SOAP message are often viewed for analysis and debugging. Tcptrace is a small tool that allows us to intercept packets on the TCP/IP protocol because HTTP, JMS, STMP and other protocols are built on TCP/IP, so you can easily intercept SOAP requests and response messages for Web service.
The Web service in our example runs on port 8080, allows Tcptrace to listen on port 8088, and forwards 8088-port listening messages to 8080 ports, so that the tcptrace can intercept the request and response soap packets.
1. Start Tcptrace and set the listening port and destination address and port
2. Adjust the URL address of the client program to the listening port:
serviceurl = "Http://localhost:8088/test/service/testWebService"
3. Re-run the client program and the user will be able to see the SOAP request and response messages in the Tcptrace