Generating a web service proxy client
Posted by Albin Joseph | Posted in RAD, WebSphere | Posted on 29-01-2008
7
Java web service client applications use a web service proxy client to interact with the Web services APIs. A proxy client allows the developer to invoke the web service APIs as if it was a local method. For generating a web service proxy client, we need the WSDL files that describe the web service interfaces. The WSDL files for business process API is BFMWS.wsdl and for human task API is HTMWS.wsdl. The steps in generating a web service are as follows. (Before following the steps, copy your WSDL files to your workspace or to some location where the WID/RAD can see your WSDL files.
Step 1.
Right click on the web project (from web perspective) and select New -> Other. The select wizard opens. Expand the web service folder and select ‘Web Service Client’.
Click Next.
Step 2.
From the web service client dialog box, accept the default values (The client proxy type would be Java Proxy, and ‘Create Folders when necessary’ checkbox would be checked and all other check boxes would be unchecked) or select the options that matches your environment.
Click Next.
Step 3.
The web service selection page opens. Click on Browse button. From the opened resource browser window, select the WSDL file. Click OK.
Click Next.
Step 4.
The client environment configuration window opens. From this page select ‘IBM WebSphere’ as the Web service runtime by clicking the Edit button, if it is not selected already. Select the client type and the client projects.
Click Next.
Step 5.
The web service proxy client page appears. Accept all the default values.
Click Finish.
The web service proxy client will be generated and we can use the generated proxy client and helper classes for invoking the web service from our client application.


(2 votes, average: 4.50 out of 5)



[...] Once we got our WSDL files, generate the web service client as mentioned in Generating a web service proxy client. [...]
Hi,
It helped me in creating WS client however I am wondering how do I test it I dont want to
. Please tell me how do I write a JavaMethod
test by right clicking on WSDL and checking it
to make a request what all should me parameters ine request and if I need to pass any URL or
something to make my request. please help.
Any help will be highly appriciated.
Hi Amit,
The metjod mentioned here for generating WS stubs is very primitive. Currently we have lot of mechanisms to do the same.
1) Decide what framework you need for your client (Axis for exmaple)
2) refer to the axis api for ANT script that will help you create a client
3) the ant script generallly takes in “testcase” as a parameter which is automatically create you a JUnit test class.
You can use the JUnit test class for testing your webservice easily.
[...] Comments Amit Mittal on Generating a web service proxy clientKathy on Finding the value of a radio buttonHarish on Start a long running business process using [...]
Amit, I have created a small tutorial of how to invoke a web service using web service proxy client and is available at http://www.albeesonline.com/blog/2008/09/15/invoking-a-web-service-using-web-service-proxy-client/. If you have any questions please let me know.
Hi Albin,
this document is realy nice,
i am new to webservises
using rad 7
please help me in creating a sample websevice
HI,
Can you plz let me know how to create a stub less web service client from wsdl…..
also plz write a test java client as well…
This will be a great help…
if u could forward the link to my email will be grt8 help
java.harpreet@gmail.com
Thank you