How to trace SOAP message in Eclipse IDE
In SOAP web service, each HTTP request or response encapsulates a SOAP envelope, these messages are easy to trace by using Eclipse IDE, build-in “TCP/IP monitor” tool. The idea is host another server in between the client and server to perform port forward function to intercept the HTTP traffic.
1. Normal SOAP envelope flows
In normal SOAP service, client send a HTTP request to server, and server send back a HTTP response to client directly.
1. Client ----> SOAP envelope ----> Server:9999 2. Server:9999 ----> SOAP envelope ---> Client
2. Intercepted SOAP envelope flows
To intercept SOAP envelope, you can host another server (“TcpMonitorServer”) in between client and server, see new flows :
1. Client ----> SOAP envelope ----> TcpMonitorServer:8888 2. TcpMonitorServer:8888 --> SOAP envelope ---> Server:9999 3. Server:9999 ----> SOAP envelope ---> TcpMonitorServer:8888 4. TcpMonitorServer:8888 ----> SOAP envelope ---> Client
This method required port changed in your web service client.
Eclipse IDE + TCP/IP Monitor
Eclipse IDE comes with a very easy to use traffic interceptor tool, known as “TCP/IP Monitor“. In this tutorial, we show you how to enable this “TCP/IP Monitor” in Eclipse IDE, and also intercept the SOAP messages generated by web service.
Here’s the steps to enable “TCP/IP Monitor” in Eclispe IDE.
1. In IDE, access Windows –> Preferences –> Run/Debug –> TCP/IP Monitor

2. Fill in server information, and choose type = “TCP/IP”

3. Click on the “start” button to start tracing the web service traffic.

4. Show the traced messaged in the “TCP/IP Monitor” view if any.

You can copy this JAX-WS web service example and do the testing yourself.
In Netbean IDE, you can use TCP monitor to trace SOAP message.







TCP/IP monitor does not work in eclipse
Yes, this is not working based on the example and configuration provided
here is the client url: http://localhost:9999/ws/hello?wsdl
and the end point http://localhost:9999/ws/hello
the TCP/IP monitor is set as follows:
local Montoring port: 8888
host name: localhost
Port: 9999
Type TCP/IP
timeout (in seconds): 0
start monitor automatically: checked
when i run the HelloWorldClient.java eclipse console displays the hello world message but no TCP/IP monitor activity?
the problem was that we need to change the client port from 9999 to 8888.
the publisher port remains 9999 but the client port is now 8888.
the concept makes sense after a while.
Thanks MK for the tutorials.
Excellent tutorial, this tcp monitor is very helpful. I would suggest that you add the following line of code to the tutorial to show how the client port number changes once the tcp monitor is setup.
can you clarify?
Hi,
While I trace SOAP message in Eclipse IDE for localhost its working fine but i used another IP address it didnt show any trace(request,response).Give a solution for that.
eg:
Local Monitoring port:8888
HostName:Localhost
port:9999
Type:TCP/IP
When using this and running my application in same pc(means localhost) its getting output correct and showing trace(request,response).
But, When i am using the following details TCP/IP monitor
Local Monitoring port:8888
HostName:123.456.7.8
port:9999
Type:TCP/IP
I am getting correct output but i didnt get trace (request,response).Here i deploy my service endpoint in another pc having IP:123.456.7.8 .
What is problem here?
Thanks,
sudheer
put in your server host name than its IP address and make sure your using the right server port ..I hope it should work .
[...] service endpoint by using JAX-WS, and showing the flow of SOAP envelope between client and server.How to trace SOAP message in Eclipse IDE Tutorial to show you how to enable this “TCP/IP Monitor” in Eclipse IDE, and also intercept the [...]
[...] From top to bottom, showing how SOAP envelope flow between client to server. See following web service client again : URL url = new URL("http://localhost:9999/ws/hello?wsdl"); QName qname = new QName("http://ws.mkyong.com/", "HelloWorldImplService"); Service service = Service.create(url, qname); HelloWorld hello = service.getPort(HelloWorld.class); System.out.println(hello.getHelloWorldAsString()); System.out.println(hello.getHelloWorldAsInt()); Note To monitor SOAP traffic is very easy, see this guide – “How to trace SOAP message in Eclipse IDE“. [...]