Thursday, January 17, 2008

Using Tcpmon tool in implementing Web Services

Tcpmon is a open source project hosted at Apache. It is a very usefull easy to use java tool when developing Web Services. Here are some of the screen shots of tcpmon tool




















As you can see all you need to do is to set listen port and target port.




















Using tcpmon tool you can varify the soap messages exchanged effectively. When you want to capture the soap messages exchanged between the client and the server, you can use tcpmon to do it very easily.

Here is a sample senario.
Say you want to capture the soap messages sent and received by a php web service client.
Since Apache2 server runs on port 80, set the target port to 80 and Listen port to some other pot. Eg 8080.

Now open the client file and set the modify the "to" endpoint as follows.

I use the echo_client.php sample from WSF/PHP here.

$client = new WSClient(array( "to" => "http://localhost:8080/samples/echo_service.php" ));

As you can see, now I am sending the client message to the listen port I set in tcpmon which is 8080. Now when the client is run, tcpmon will capture the message, display it and also send the message to Apache2 as well. Above picture 2 shows the output captured .

3 comments:

  1. For another option, or if you need to see HTTPS/SSL traffic, have look at my opensource project DonsProxy, at http://donsproxy.sourceforge.net/.

    ReplyDelete
  2. Hi iam a new bie and iam using apache axis to develop webservices

    can u pls tell me where i must keep the tcpmon to monitor and ways to run it

    ReplyDelete