| <html><head><META http-equiv="Content-Type" content="text/html; charset=UTF-8"><link type="text/css" href="../../../../../..//default_style.css" rel="stylesheet"><link type="text/css" href="../../../../../..//webtools/wtp.css" rel="stylesheet"><title>Consuming Web service using Web Service Client</title></head><body><table border="0" cellpadding="2" cellspacing="5" width="100%"><tbody><tr><td align="left" width="60%"><font class="indextop">Consuming Web service using Web Service Client</font><br><font class="indexsub">Consuming Web service using Web Service Client</font></td><td width="40%"><img src="../../../../../..//webtools/images/wtplogosmall.jpg" align="middle" height="129" hspace="50" width="207" alt="WTP Logo" usemap="logomap"><map id="logomap" name="logomap"><area coords="0,0,207,129" href="/webtools/" alt="WTP Home"></map></td></tr></tbody></table><table border="0" cellpadding="2" cellspacing="5" width="100%"><col width="16"><col width="*"><tbody><tr><td align="right" valign="top"> | |
| | |
| </td><td valign="top"><p> | |
| <b>By Kathy Chan</b> | |
| <br> | |
| September 19, 2005 | |
| <br> | |
| <br> | |
| </p></td></tr><tr><td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">Introduction</font></b></td></tr><tr><td align="right" valign="top"> | |
| | |
| </td><td valign="top"><br></td></tr><tr><td align="right" valign="top"> | |
| | |
| </td><td valign="top"><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 with the <b>WTP 1.0 M8 drivers</b>. | |
| </p></td></tr><tr><td align="right" valign="top"> | |
| | |
| </td><td valign="top"><p> | |
| This tutorial shows how to create a Web serivce client to a | |
| deployed Web service created in | |
| <a href="TopDownWebService.html"> | |
| Creating a top down Web service | |
| </a>. | |
| </p></td></tr><tr><td align="right" valign="top"> | |
| | |
| </td><td valign="top"><br></td></tr><tr><td colspan="2" align="left" bgcolor="#0080c0" valign="top"><b><font color="#ffffff" face="Arial,Helvetica">Create a Web service Client</font></b></td></tr><tr><td align="right" valign="top"> | |
| | |
| </td><td valign="top"><ol> | |
| <li> | |
| Select the <b>AreaServiceSOAP.wsdl</b> file in the | |
| <b>Area\WebContent\wsdl</b> folder created in | |
| <a href="TopDownWebService.html"> | |
| Creating a top down Web service | |
| </a> tutorial. | |
| <br><b>Do not</b> select the AreaService.wsdl | |
| file in the <b>Area\WebContent</b> folder. | |
| </li> | |
| <li> | |
| Open <b>File -> New -> Other... -> Web Services -> Web | |
| Service Client</b>. | |
| </li> | |
| <li>Click <b>Next</b>.</li> | |
| <li> | |
| Select | |
| <b>Test the Web service</b> | |
| and | |
| <b>Overwrite files without warning</b>. | |
| </li> | |
| <br> | |
| <img border="0" SRC="resources/client1.JPG"> | |
| <br> | |
| <li>Click <b>Next</b>.</li> | |
| <br> | |
| <img border="0" SRC="resources/client2.JPG"> | |
| <br> | |
| <li> | |
| Click <b>Next</b> and accept the defaults on the <b>Web Service Selection Page</b>. | |
| </li> | |
| <li> | |
| On the <b>Client Environment Configuration</b> page, type in | |
| <b>AreaProjectClient</b> | |
| as the name of the Client project and <b>areaClient</b> as the Client module. | |
| <br> | |
| 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> | |
| <br> | |
| <img border="0" SRC="resources/client3.JPG"> | |
| <li> | |
| Click <b>Finish</b>. | |
| </li> | |
| <li> | |
| It will take about one minute for the wizard to assemble | |
| the Web service client Web projects, start Apache | |
| Tomcat, and deploy the project to Tomcat. Once | |
| finished, the generated Sample JSP Web application will | |
| appear in the browser view. | |
| </li> | |
| <li> | |
| Under | |
| <b>Methods</b>, click on | |
| <b>calculateRectArea</b> | |
| . | |
| </li> | |
| <li> | |
| Under | |
| <b>Inputs</b>, enter | |
| <tt>2.0</tt> | |
| and | |
| <tt>5.0</tt> | |
| into the height and width entry field. | |
| </li> | |
| <li> | |
| Click on | |
| <b>Invoke</b>. In the <b>Result</b> view, you should get a response of | |
| <b>10.0</b>. | |
| </li> | |
| <br> | |
| <img border="0" SRC="resources/client4.JPG"> | |
| </ol></td></tr></tbody></table></body></html> |