blob: 47a0c998b6f43575f186b1058c46cb3ce510c809 [file] [log] [blame]
<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" href="../../../../../wtp.xsl"?>
<html>
<head>
<meta name="root" content="../../../../../../" />
<title>Creating Top Down Web Service</title>
</head>
<body>
<h1>Creating Top Down Web Service</h1>
<p>
<b>By Kathy Chan</b>
<br />
November 23, 2005
<br />
<br />
</p>
<h2>Introduction</h2>
<br></br>
<p>
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 <b>WTP 1.0 M9 drivers</b>.
</p>
<p>
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.
</p>
<br></br>
<h2>Set Up</h2>
<br></br>
<p> Before creating the Web service, there are two
prerequisites: </p>
<ol>
<li>
<a href="InstallTomcat.html">Install Apache Tomcat</a>
</li>
<li>
<a href="CreateWebProject.html">
Create a dynamic Web project
</a>
called
<tt>AreaProj</tt>
.
</li>
</ol>
<h2>Create a top down Java bean Web service</h2>
<ol>
<li>
Import the file
<a href="resources/AreaService.wsdl">AreaService.wsdl</a>
into AreaProj/WebContent.
</li>
<li>Select the <b>AreaService.wsdl</b> file.</li>
<li>
Open File -&gt; New -&gt; Other... -&gt; Web Services -&gt; Web
Service.
</li>
<li>Click <b>Next</b></li>
<li>
In the Web service type combo, select
<b>Top down Java bean Web Service</b>
.
</li>
<li>
Select
<b>Overwrite files without warning</b>
. Result:
</li>
<br/>
<img border="0"
SRC="resources/td1.jpg" />
<br/>
<li>
Click
<b>Next</b>
. Result:
</li>
<br></br>
<img border="0"
src="resources/td2.jpg" />
<br></br>
<li>
Click
<b>Next</b>
to get to the
<b>Service Deployment Configuration Page</b>
. Result:
</li>
<br></br>
<img border="0"
src="resources/td3.jpg" />
<br></br>
<li>
If you want to choose a server different
from the one defaulted by the wizard, click the
<b>Edit</b>
button to:
<a href="SelectServer.html">
select a server
</a>
</li>
<li>
Click
<b>Finish</b>.
</li>
<li>
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
<b>AreaServiceSOAPImpl.java</b>
will appear in the browser view. Fill in the expression
<b>parameters.getHeight()*parameters.getWidth()</b>
as the return value for the <tt>calculateRectArea</tt> method and save the file.
</li>
<br />
<img border="0"
SRC="resources/td4.jpg" />
</ol>
<p>
Follow the instructions at
<a href="WebServiceClient.html">
Creating Web Service Client
</a>
to create a Web service client that you can then use to test this Web service.
</p>
</body>
</html>