Provide a short description for this tutorial lesson.
You must now locate a Web service for which you want to create
a client. This Web service can be on a private or public UDDI registry, at
a URL, or in your workspace. For this tutorial, we will search for a Web service
that returns the temperature for a given zip code that is provided by www.xmethods.com.
You
can find a Web service and create a proxy for the Web service using the Web
Service Discovery wizard:
- On the Palette select the Data tab.
Select Web Service, right-click and click Insert. Note that you need to be in the Web perspective to see the Palette.
- Select Web services from a known URL. Although
we know the URL for the WSDL file, by using a Web Service Inspection Language
(WSIL) file you can search all the Web services which are available. WSIL
files are frequently found at a location similar to the following: http://www.web_service_provider.com/inspection.wsil
- Enter the following WSDL URL in the URL field: http://www.xmethods.net/sd/2001/DemoTemperatureService.wsdl and
click Go.
- The Web service we have selected is now displayed in the table.
Click Port: TemperaturePort to select it. To test the Web service, click Details to launch
the Web service in the Web Services Explorer. For more information about using
the Web Services Explorer, refer to the online help.
- Once you have tested the Web service, click Add to Project.
If you are prompted to overwrite files on your system click Yes
to All.
- The Web service you selected is now listed in the list of existing
Web services. When you select it the only method available for this Web service
is listed in the methods list. Click Finish to add
it to your JSP.
The proxy should now be shown in the Page Data view. If the Page
Data view is not displayed you can open it by clicking :
Additionally, the method and the action to invoke
it have been added to the JSP file. It should look similar to the following: