Submitted on November 9, 2009 - 01:58.

Web services have become mainstream and many create and consume Web services for their day to day operations. Every piece of Web service we write today is not 100% perfect and has few bugs. When an issue occurs in the web service it takes tremendous amount of time to go through the code and resolve if you don't have the perfect tools to do it.
This tutorial helps you to easily debug your Web service using eclipse IDE. Regardless whether you are a developer or an admin or a simple user you will find this tutorial simple enough to understand in order to debug any Web service you want to find issues.
The 3 steps are
The first step is to just create a Web service so that we can debug it later.
Note: Visit the resources section of this tutorial to find out from where to download the prerequisites or click the above links.
You may also download the resources for this tutorial from the resources section.
If you have done this tutorial
on creating Web services you can use the same workspace and can skip step 1.
Create a Web service using the following instructions
(Try this tutorial on more instructions on how to follow above instructions.)
Put some debug breakpoints in the source code in places which you want the debugging to hit.
While you are in the "Java EE" perspective click on the "Servers" view. Select WSO2 Web Services Application Server (WSO2 WSAS) which your service is published in. Click "Start the server in debug mode" button in the "Server" view.
That's it. So basically all you have to do now is to invoke your service (We can use the "Try it" feature in WSO2 Web Services Application Server (WSO2 WSAS) to invoke the Web service) and see how eclipse brings up the debugging perspective with your favourite debugging tools.
Eg:
Lets invoke our Web service and see. I'm going to use the "Try it" feature in WSO2 Web Services Application Server (WSO2 WSAS) to invoke our web service
You might notice that your eclipse editor will flash in task bar and when focus will notice that it will either ask you to
switch to debugging perspective (if so click "Yes") or already in debugging perspective.
Lets step over to the next line and change the value of the variable area to something else (say "100").
and click the "Resume" button in the "Debug" view to continue the execution. Check out the result in the "Try it" page which we invoked the Web service in the first palce.
With the use of WSO2 Web Services Application Server (WSO2 WSAS) Tools you can easily debug your Web service just like debugging your Java application in eclipse.
Saminda Wijeratne, Senior Software Engineer, WSO2, samindaw@wso2.com
| Attachment | Size |
|---|---|
| debug-webservice-eclipse-wsas-29.JPG | 55.67 KB |
| debug-webservice-eclipse-wsas-30.JPG | 42.66 KB |
| debug-webservice-eclipse-wsas-32.JPG | 34.07 KB |
| debug-webservice-eclipse-wsas-34.JPG | 59.72 KB |
| debug-webservice-eclipse-wsas-36.JPG | 60.06 KB |
| debug-webservice-eclipse-wsas-37.JPG | 33.6 KB |