blob: 0d133c2aaf449dd9d38ed2dcf4337f83a4c42911 [file] [log] [blame]
<html>
<head>
<META http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="../../../../../..//default_style.css" type="text/css">
<link rel="stylesheet" href="../../../../../..//webtools/wtp.css" type="text/css">
<title>Top Down Web Service Supporting Flexible Projects</title>
</head>
<body>
<table width="100%" cellspacing="5" cellpadding="2" border="0">
<tbody>
<tr>
<td width="60%" align="left"><font class="indextop">Top Down Web Service Supporting Flexible Projects</font>
<br>
<font class="indexsub">Top Down Web Service Supporting Flexible Projects</font></td><td width="40%"><img width="120" hspace="50" height="86" align="middle" src="../../../../../..//images/Idea.jpg"></td>
</tr>
</tbody>
</table>
<table width="100%" cellspacing="5" cellpadding="2" border="0">
<col width="16">
<col width="*">
<tbody>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<p>
<b>By Kathy Chan</b>
<br>
April 29, 2005
<br>
<br>
</p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font face="Arial,Helvetica" color="#ffffff">Introduction</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<br>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<p>
This document is a one of a series of tutorials to
demonstrate the use of the Web Services tools in the Web
Tools Platform Project using the <b>M4 driver</b>.
</p>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<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>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<br>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font face="Arial,Helvetica" color="#ffffff">Set Up</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<br>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<p>
Before creating the Web service, there are two
prerequisites:
<ol>
<li>
<a href="InstallTomcat.html">
Install Apache Tomcat
</a>
</li>
<li>Create a Web project</li>
<ol>
<li>
Open
<b>
File -&gt; New -&gt; Other... -&gt; Web -&gt; J2EE Web
Module
</b>
to create a new flexible project and Web module
.
</li>
<li>Click <b>New...</b>
</li>
<li>
Enter
<tt>AreaProject</tt>
into the
<b>Name</b>
field.
</li>
<li>
Ensure that the
<b>Target server</b>
is set to
<b>Apache Tomcat v5.0</b>
.
</li>
<li>Click <b>Finish</b>. Result: </li>
<br>
<img border="0" SRC="resources/AreaProject.JPG">
<li>
Enter
<tt>area</tt>
into the
<b>Module Name</b>
field.
. Result:
</li>
<br>
<img border="0" SRC="resources/area.JPG">
<li>
Click
<b>Finish</b>
.
</li>
</ol>
</ol>
</p>
</td>
</tr>
<tr>
<td valign="top" bgcolor="#0080c0" align="left" colspan="2"><b><font face="Arial,Helvetica" color="#ffffff">Create a top down Java bean Web service</font></b></td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<ol>
<li>
Import the file
<a href="../../M3/tutorials/resources/TopDownWebService/AreaService.wsdl">AreaService.wsdl</a>
into AreaProject/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>
In the Web service type combo, select
<b>Skeleton Java bean Web Service</b>
.
</li>
<li>
Select
<b>Overwrite files without warning</b>
. Result:
</li>
<br>
<img border="0" SRC="resources/td1.JPG">
<li>
Click
<b>Next</b>
. Result:
</li>
<br>
<img border="0" src="resources/td2.JPG">
<li>
Click
<b>Next</b>
to get to the
<b>Service Deployment Configuration Page</b>
. Result:
</li>
<br>
<img border="0" src="resources/td3.JPG">
<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
<b>parameters.getHeight()*parameters.getWidth()</b>
as the return value and save the file.
</li>
<br>
<img border="0" SRC="resources/td4.JPG">
</ol>
</td>
</tr>
<tr>
<td valign="top" align="right">&nbsp;</td><td valign="top">
<p>
Follow the instruction at
<a href="WebServiceClient.html">
Creating Web Service Client
</a>
to create a Web service client to test this Web service.
</p>
</td>
</tr>
</tbody>
</table>
</body>
</html>