Web Service Client using Bottom up approach in Eclipse

This post is in continuation to http://jugnu-life.blogspot.com/2011/08/getting-started-with-web-services.html

This post will cover how to Create a new Web Service Client project , bottom up approach of development.


Web Service Client Project

In the Wizard paste the URL of WSDL copied earlier

Sect Axis Runtime as Apache Axis2

Click on Client Project and Enter new New Client Project Name BottomUpWebServiceClient , it will automatically become of type Dynamic Project . Its fine.



Drag up the slider for client and make it start

Click Next


Keep all settings as default


Generate a Junit test case to test the service

Click Finish

That completes the Client generation process

Now we will test this what we have created

In the test package

Open the file CalculatorTest.java


In the TODO you can see we have two methods , add and subtract

Add the following lines for subtract and add methods TODO




I am just passing values of parameter c and d as 10 and 30 respectively

Similarly for addition we can write like



I am just passing values of parameter a and b as 100 and 30 respectively

Save the file

RightClick on CalculatorTest and Select Run As Junit Test

All the 4 tests should pass as shown below


That completes the WSDL creation, client creation and testing process using bottom up approach