Tracing SOAP messages with tcpmon
This topic discusses tracing SOAP messages that request Web services by using the tcpmon tool.
You can use other trace tools to trace SOAP messages, similar to how you can trace Web services components. See Tracing Web services for more information about these other trace tools.
It is not recommended that you use the tcpmon tool in a stressed environment. Tcpmon is only for monitoring SOAP messages in a lightweight environment.
Overview
You can trace SOAP messages exchanged between a client and the server by installing a monitor or sniffer application to capture the HTTP traffic between the two points. The WebSphere product provides a utility class, com.ibm.ws.webservices.engine.utils.tcpmon, to trace the SOAP messages. The com.ibm.ws.webservices.engine.utils.tcpmon class redirects messages from a port, records the messages, and forwards the messages to another port.
WAS typically listens on port 9080, or port 80 if you are using IBM HTTP Server. The tcpmon process can be configured to listen on a particular port, such as 9088, while redirecting messages to another port, such as 9080 or port 80. The client is redirected to use port 9088 to access Web services.
Redirecting an application client to a different port is done by changing the SOAP address in the client Web Services Description Language (WSDL) file to use port 9088 and then running the wsdeploy command-line tool on the client enterprise archive (EAR) file to regenerate the service implementation.
Trace SOAP messages in Web services by following the actions listed in the steps for this task section.
Procedure
- Set up a development and unmanaged client run-time environment for Web services.
- Run the java -Djava.ext.dirs=%WAS_EXT_DIRS% com.ibm.ws.webservices.engine.utils.tcpmon command. A window labeled TCPMonitor is displayed.
- Configure the TCPMonitor to listen on port 9088 and forward messages to port 9080.
- In the Listen Port # field, enter 9088.
- Click Listener.
- In the TargetHostname field, enter localhost.
- In the Target Port # field, enter 9080.
- Click Add.
- Click the Port 9088 tab that displays on the top of the page.
Results
The messages exchanged between the client and server appear in the TCPMonitor Request and Response pane.
What to do next
Save the message data and analyze it.
Tracing Web services
Troubleshooting Web services