Testing a web service using Eclipse

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.

Eclipse - Installing New Software
Eclipse – Installing 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.

Eclipse - Install New Software - Axis2
Eclipse – Install New Software – Axis2

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.

Eclipse - Launch Web services explorer
Eclipse – Launch Web services explorer

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.

Eclipse - View UDDI Main in the Navigator
Eclipse – View UDDI Main in the Navigator

5) Now you can invoke the WSDL page by clicking the icon above the right side panel as indicated in the figure.

Eclipse - Invoke WSDL main page
Eclipse – Invoke WSDL main page

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.

Eclipse - Enter the WSDL URL
Eclipse – Enter the WSDL URL

7) The web service details are displayed. Now select the appropriate method and invoke the actions for the selected method.

Eclipse - Note the web service details
Eclipse – Note the web service details

8) The input parameter to be entered is displayed to you. Enter a valid value and click Go.

Eclipse - Enter WSDL Input
Eclipse – Enter WSDL Input

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.

Eclipse - your web services output response
Eclipse – your web services output response

 

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

Fiddler Options
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.

Fiddler listening port
Fiddler listening port

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.

 

 

Advertisements

One thought on “Testing a web service using Eclipse”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s