Thursday, July 3, 2008

Using TCP Monitor to Debug Web Service Calls

TCP Monitor is a great tool when it comes to debugging Web Service calls. It acts as a proxy between your client and the actual service, hence it helps you to have a look at the wire message and figure out whats going on. It comes as an IDEA and Eclipse plugin as well.

Here is how you configure the TCP/IP Monitor Plugin in IDEA.

1. Goto File->Settings->Plugins
2. Search for TCP and you will find Axis TCP Monitor Plugin
3. Right click->Download and Install
4. Restart IDEA
5. You will see TCPMON appear on the right panel. You could also access it at Window->Tool Windows->TCPMON
6. Set Listen port # to 8080, Target HostName (The place where the service is at, if its running locally localhost), Target Port # (the port which the service is running on)
7. Click add
8. Configure your client to send the request to the TCP monitor instead of the actual service (for e.g localhost:8080) and the TCP monitor will forward it to the actual service. You will see the message on the TCP monitor.

Here is how you configure the TCP/IP Monitor Plugin in Eclipse.

1. Goto window->show view->other
2. Search for TCP and you will find TCP/IP Monitor
3. Right click->properties
4. click add
5. Set local monitoring port to 8080, host name (The place where the service is at, if its running locally localhost), port (the port which the service is running on)
6. Configure your client to send the request to the TCP monitor instead of the actual service (for e.g localhost:8080) and the TCP monitor will forward it to the actual service. You will see the message on the TCP monitor.

8 comments:

ijajaja said...

When running the client, i see the something appear in TCP/IP Monitor. Through many tutorials i google. The message viewed in TCP/IP Monitor can be modified and resent again. When trying to modified and resent, i get the fault response : Invalid Chunk. I wish you could point out what the error is. Thanks in advance!!!

TD said...

Se ha diseñado e implementado un sistema, el cual usa principalmente la tecnología de comunicación de datos, de redes de computadoras y el paradigma Cliente-Servidor,
. El sistema permite conocer la cantidad de información que circula en una red local, es decir, permite monitorear su tráfico

Gerin Jacob said...

I have used tcp mon successfully in Windows. Is there a way to use it in Unix? (where you dont have a GUI)

pkhach said...

Some free (Fiddler Web Debugger: http://www.fiddlertool.org) and commercial (HTTP Debugger Pro ($50): http://www.httpdebugger.com) tools are available on the market that allow to debug Web Services.

pkhach said...

Some free (Fiddler Web Debugger: http://www.fiddlertool.org) and commercial (HTTP Debugger Pro ($50): http://www.httpdebugger.com) tools are available on the market that allow to debug Web Services.

Unknown said...

Hi,
How can I configure the client to send the request to the TCP monitor instead of my service service???
Does tcpmon know wich service it will invoke??? If so, how can I tell tcpmon to invoke an specific service??

Keith Chapman said...

Say your service resides at http://foo:8888/a/b/c and tcp mon is running on machine bar and listening on port 9999. Change your client to send the request to http://bar:9999/a/b/c and tcpmon will record and forward the message to http://foo:8888/a/b/c. Most often that not the service you wanna invoke is in the request URI so the server would take care of it tcpmon just acts like a man in the middle, its dumb and just records the message and forwards it.

Sandeep said...

say you were using port 8080 in server and monitor has been now configured to listen to 9090, you should be sending the requests on port 9090 which well get automatically redirected to port 8080.
If someone is looking for screenshots for these steps, then see my tutorial on Eclipse TCP/IP Monitor