Skip to main content

Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Using Web Service Explorer to test a Web service

Revision as of 22:54, 29 January 2008 by Unnamed Poltroon (Talk)

Using Web Service
   Explorer to test a Web service 
Using Web Service Explorer to test a Web service
<img src="http://www.eclipse.org//webtools/images/wtplogosmall.jpg" align="middle" height="129" hspace="50" width="207">
<colgroup> <col width="16"><col width="1*"> </colgroup>
  By Kathy Chan
   December 22, 2005 

 
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 a WTP 1.0 driver.
  This tutorial shows how to use the Web Service Explorer to
   test a Web service via native WSDL and SOAP. It demonstrates how to use the 
   Web Services Explorer to invoke operations on a Web service named "
   <a href="http://www.xmethods.net/ve2/ViewListing.po;jsessionid=0G-Gfc2ErUGlADxkgZE84pcE(QHyMHiRM)?key=uuid:889A05A5-5C03-AD9B-D456-0E54A527EDEE">
   Delayed Stock Quote </a>" as available from
<a href="http://www.xmethods.net/">XMethods</a> on the internet.
  The only prerequisite is that you be connected to the
   internet. If you are connected via a firewall, you can use the Internet 
   preferences page (choose Preferences -> Internet from the main menu). 
   Otherwise, you can begin with a completely fresh workspace and no installed 
servers.
 
 
   Using the Web Services Explorer 
to test a Web service
 
 
 
  1. Launch the Eclipse WTP workbench.
  2. From the main menu bar, select Run -> Launch the Web Services Explorer. This will take a few moments the first time while Eclipse's internal Tomcat server starts up and loads the Web Services Explorer application.
  3. After the Web Browser view opens, maximize it. Result:
    <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wse_uddi.JPG" border="0" width="801" height="665">
  4. In the Web Service Explorer's toolbar (top-right), click on the WSDL Page icon,
    <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wsdl.gif" border="0" width="16" height="16">
     
  5. Click on the <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wsdl_main.gif" border="0" width="16" height="16"> WSDL Main icon. Result:
    <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wse_wsdl.JPG" border="0" width="766" height="535">
  6. In the WSDL URL field, enter the URL http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl , then click on Go . Result:
    <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wse_stockquote.JPG" border="0" width="818" height="663">
  7. Under Operations in the right hand pane, click on getQuote. Result:
    <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wse_getquote.JPG" border="0" width="818" height="663">
  8. In the symbol String entry field, enter ibm, then click on Go . In the Status pane, you should see an answer like this:
    return (float): 79.28

    You may need to move the horizontal bar separating the Actions and Status panes upwards a bit to get a better view. Result:


    <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/wse_stockprice.JPG" border="0" width="818" height="663"> </li> </ol> </td> </tr>

   Explanation</td>
 </tr>
 </td>

 </td>

 </tr>
 </td> The Web Services Explorer is a JSP Web application hosted
   on the Apache Tomcat servlet engine contained within Eclipse. It is 
   integrated into Eclipse on two levels: visually by virtue of it running in 
   the embedded browser, and logically by virtue of it running as a thread in 
   the Eclipse JRE. Though not demonstrated in this scenario, this latter type 
   of integration allows the Web Services Explorer to access resources in the 
   workspace, write resources into the workspace, and launch various Web 
   services wizards. </td>
 </tr>
 </td> The Web Services Explorer provides three key services to
   the user: </td>
 </tr>
 </td>
  1. Comprehensive support for discovering Web services in WS-Inspection 1.0 documents, and in UDDI v2 or v3 registries using the UDDI v2 protocol.
  2. Comprehensive support for publishing Web services to UDDI v2 or v3 registries using the UDDI v2 protocol.
  3. Comprehensive support for browsing and invoking Web services natively via their WSDL and XSD.
   </td>
 </tr>
 </td>
   <img src="http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/WebServiceExplorer/images/note.gif" alt="Note: " border="0" width="62" height="13">
   
A key point of the scenario above is that no code was generated and no servers were required in order to invoke operations on the WSDL</td> </tr>
</table>

Back to the top