WorkShop n°6 : Debugging a web service client program
In this workshop we are going to monitor and debug a very simple webservice client program.
The web service is a free online webservice capable of returning the country of a given ip adress. The client is a java client generated with Eclipse.
1- First, let's generate our client code (if you already have a client go to step 2)
Now, let's create a client code like this one in order to instantiate the generated proxy class :
2- You can run it and check and the web service is responding.
Now, let's set up your java program to use TcpCatcher proxy.
No change in code is required, just add those vm arguments in your Eclispe launch configuration:
Run client program again, now you can clearly monitor your SOAP conversation because XML is pretty printed and loaded in a treeview
which makes it easy to read.
Of course "someip" is not a valid ip, but for desmonstration purpose we now have a buggy web service call.
Now, lets turn on catch mode and run client program again.
In first packet, we are going to replace "someip" with some valid ip
Note, that Content-Length value is automatically recomputed by TcpCatcher so you don't need to bother about that, you HTTP request will still be correct.
Click on 'Send it ! (and stop catching)'.
The Web Service is now responding with our ip location.
|Report a bug or
suggest a new feature