|
By Kathy Chan
June 29, 2006
|
Introduction |
|
|
|
This document is one of a series of tutorials to
demonstrate the use of the Web Services tools in the Web
Tools Platform Project using the WTP 1.5 drivers.
|
|
This tutorial shows how to create a simple top-down Web
service from a WSDL file. The WSDL file in this scenario
calculates the area of an rectangle.
|
|
|
Set Up |
|
|
| Before creating the Web service, there are two
prerequisites: |
|
-
Install Apache Tomcat
-
Create a dynamic Web project
called
AreaProj
.
|
Create a top down Java bean Web service |
|
-
Import the file
AreaService.wsdl
into AreaProj/WebContent.
- Select the AreaService.wsdl file.
-
Open File -> New -> Other... -> Web Services -> Web
Service.
- Click Next
-
In the Web service type combo, select
Top down Java bean Web Service.
-
Move the Service slider to the
Start Service position.
-
Result:
-
If you want to choose a server different
from the one defaulted by the wizard, click the
Service project
link to
select a server
-
Click
Finish.
-
It will take about one minute for the wizard to assemble
the Web service projects, start Apache Tomcat and deploy
the projects to Tomcat. Once finished, the Java
implementation file
AreaServiceSOAPImpl.java
will appear in the browser view. Fill in the expression
parameters.getHeight()*parameters.getWidth()
as the return value for the calculateRectArea method and save the file.
|
|
Follow the instructions at
Creating Web Service Client
to create a Web service client that you can then use to test this Web service.
|