
http://localhost:8787/codejava/fileService?wsdl
Click Window > Preferences from Eclipse’s main menu, then select Run/Debug > TCP/IP Monitor on the left side in the Preferences dialog:
Click the Add button on the right, the New Monitor dialog appears. Enter the information as follows:
Click OK to close the Preferences dialog. Now, we need to show the TCP/IP Monitor view by going to Window > Show View > Other..., and select the TCP/IP Monitor from the list:
Click OK, the TCP/IP Monitor view gets displayed but there is no data because there isn’t any communications between the client the server:
Let’s execute the client program (WebServiceClient.java), and we see the TCP/IP Monitor captured the request and response as shown in the following screenshot:
As we can see, the monitor shows the raw request and response in plain text format so that we can spot and analyze the SOAP messages sent from the client as well as returned from the server, along with other useful information. In addition, using this TCP/IP Monitor we can also modify the request, re-send the request and view the request/response in different views (Byte, Image, XML, Web browser). Let experiment these features yourself.To stop monitoring, re-visit the TCP/IP Monitor section in the Preferences dialog (or right click inside the TCP/IP Monitor view and select Properties). Then select the monitor you want to stop, and click Stop:
ConclusionSo far we have demonstrated how to use the TCP/IP monitor in Eclipse IDE to watch the client-server communications in general as well as analyzing SOAP messages in cases of web services applications, and see that it’s pretty easy to use. But remember to change the server port number in the client code after using the monitor.
Nam Ha Minh is certified Java programmer (SCJP and SCWCD). He began programming with Java back in the days of Java 1.4 and has been passionate about it ever since. You can connect with him on Facebook and watch his Java videos on YouTube.