Testing a web service using Eclipse
Testing a web service. Are you?
With increased technological advancements, we are seeing a huge awareness in using web services and testing them.
As some zealous developers put it, “No matter how easy it is to invoke WSDL, if you don’t know what the object was supposed to do, I don’t believe you can test it.”
As the lines suggest, a tester needs to be more inclined to the inside facts and know how to test. Testing has become a continuous activity at each and every step in the software development process.
Challenges in Web service testing
- Since Web services are composed of loosely coupled components distributed over networks, we must test the application
– end to end;
– service by service;
– and interface by interface.
- With increased use of web services, the functional testing over the web becomes easy (provided that you trust the web services).
- It also becomes increasingly important for us to test the web services so that you can trust its effectiveness.
Let’s look at an effective way to test the web services using Eclipse
The steps we are gonna see will explain how to instal the web services updates too.
1) Open Eclipse and select Help >> Instal New Software.
2) In the Instal software window, enter the path as “http://download.eclipse.org/webtools/updates“. You will notice the list of components that can be installed. You need to select the checkbox related to “Axis2 Tools” for having the Web Tools enabled.
3) Once you are through with the installation of the Web Tools component, you can launch the Web services component by clicking the icon as indicated in the figure below.
4) On invoking the web services, you will see two sections. The left panel (Navigator) will show the UDDI Main component and the right panel will show the Actions related to the component.
5) Now you can invoke the WSDL page by clicking the icon above the right side panel as indicated in the figure.
6) The WSDL Main component is shown in the Navigator panel now. Click the “WSDL Main” node to invoke the actions in the right panel. You can enter the URL and click Go. Please refer to the figure given below.
7) The web service details are displayed. Now select the appropriate method and invoke the actions for the selected method.
8) The input parameter to be entered is displayed to you. Enter a valid value and click Go.
9) Eclipse executes your soap request and the output is displayed. Now validate the output with respect to the input that was given. Viola!!! There you are with a very simple approach to web services testing.
10) To harness the power of FIDDLER to carry out a performance test (based on response time) on these web services being tested through Eclipse; you can do the following.
(a) Invoke Fiddler
(b) Go to Tools >>>> Fiddler Options
(c) When the Fiddler options popup window is invoked, Go to the “Connections” tab
(d) You will see an option indicating “Fiddler listens on port”
(e) Set the port number to 8888.
Now, return back to testing your web service in Eclipse.
What do you see?
Yes, Provided that you have enabled the “Capture Traffic”, you will find web services functionality being tested by Eclipse and the performance (based on response time) being tested effectively by Fiddler.