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.

clip_image001[4]

clip_image001[6]

Drag up the slider for client and make it start

Click Next

clip_image001[8]

Keep all settings as default

Select

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

clip_image002

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

Add the following lines for subtract and add methods TODO

clip_image002[4]

subtract8.setC(10);

subtract8.setD(30);

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

Similarly for addition we can write like

sum10.setA(100);

sum10.setB(30);

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

clip_image002[6]

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

1 comment:

  1. Hi Jagat Jasjit Singh,

    Its very nice to see the article and the way you have explained it. Although i am very new to web services but seeing your post got very encouraged and thanks for really lighting my problem as you do eventually for others.
    It would be very great if you could further enhance the prog to show us the junit failure cases also as i see only the pass cases.
    Can we also extract all the failure cases from the prog and document it?

    Thanks

    ReplyDelete

Please share your views and comments below.

Thank You.