tumblr counter

TCPMon Tutorial

TCPMon Tutorial explains step by step details of How to debugging web service using TCPMon.

What is TCPMon & How to Use TCPMon?

Apache TCPMon is an open-source tool / debugger for checking the data flowing through TCP network. TCPMon placed intermediate to a consumer and a server. The consumer is made to contact with TCPMon, and TCPMon further send the data to the server and will shows on in its Graphical User Interface(GUI).

Apache TCPMon utility is using for monitoring soap message

You can also configure, TCPMon with Apache AXIS in order to monitor the traffic

For example if you, created webservice is deployed using Apache CXF or Apache AXIS, you can able to monitor traffic on TCP connections by using this tool  

Required Libraries

Install / Configure TCPMon

Thinking that webservice is already up and is available on the port 8080 (My server is Tomcat, So Tomcat default port). If not, please check this article CXF Web Service Tutorial

Steps (Please see the following screen shot)

  1. Set Listen Port # as 8081 ( Assuming that port 8081 is free on your system )
  2. Leave Target Hostname as 127.0.0.1
  3. Set Target Port # as 8080

Configure TCPMon

Now add the button, We get a new tab opened with as "port 8081". For monitoring the request/response we need to invoke the service. So just run the following client for simulating.

Note

Please check that client is calling listening port (8081) and not Tomcat port where web service is running (8080)

Simulate / Monitor TCPMon

package com.client;

import org.apache.cxf.interceptor.LoggingInInterceptor;
import org.apache.cxf.interceptor.LoggingOutInterceptor;
import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;

import com.student.ChangeStudentDetails;
import com.student.Student;

// Monitor SOAP Message using TCPMon

public class StudentClient {

   
public static void main(String args[]) throws Exception {

     
JaxWsProxyFactoryBean factoryBean = new JaxWsProxyFactoryBean();

      factoryBean.getInInterceptors
().add(new LoggingInInterceptor());
      factoryBean.getOutInterceptors
().add(new LoggingOutInterceptor());
      factoryBean.setServiceClass
(ChangeStudentDetails.class);
      factoryBean.setAddress
("http://localhost:8081/CXFTutorial/services/ChangeStudent?wsdl");
      ChangeStudentDetails client =
(ChangeStudentDetails) factoryBean.create();
      Student student =
new Student();
      student.setName
("Rockey");
      Student changeName = client.changeName
(student);
      System.out.println
("Server response: " + changeName.getName());
   
}

}

Running TCPMon

Running TCPMon













Apache TCPMon Using TCPMon Monitor How To Debug Web Services Using TCPMon Monitor SOAP Message Using TCPMon Apache TCPMon Utility Web Service Debugging Tool - TCPMon Monitor With TCPMon Monitor TCP Connections TCPMon Windows TCPMon SOAP Trace Utility Tutorial About Apache TCPMon

You might also like following tutorials :

Java Tutorial Apache CXF Tutorial Hibernate Tutorial Spring Tutorial Struts Tutorial
3 Comments on "TCPMon Tutorial"
23.05.2013 10:14:01 Glapy
Can I use tcpmon tutorial for monitoring web services implemented other than CXF Framework?
03.06.2013 12:15:11 admin
You can use tcpmon tutorial for debugging not only CXF Frameworks but also other webservice frameworks 
02.05.2014 04:03:52 Paul Caruana
I can't to figure how to save TCPMON settings betwen IntelliJ sessions. Is this possible