Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

Difference between revisions of "Using Web Service Explorer to test a Web service"

Line 41: Line 41:
 
<BR>
 
<BR>
  
<P>Editing the schema is achieved by invoking context menu actions on selected objects in the Graph view and
+
  6. In the WSDL URL  field, enter the URL  http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl , then click on Go  . Result:
using the properties view to modify the properties of the selected object. Go back to the top-level view and follow the steps below to create a new element
+
declaration and define its content.</P>
+
  
<OL>
+
  7. Under Operations in the right hand pane, click on getQuote. Result:
+
<LI>right click on the header of the 'Elements' section of the top level schema and choose 'Add Element'</LI>
+
+
<LI>use the properties view to change the name of the element to 'Paper'
+
  [[Image:Xsdeditor-figure3.JPG]]
+
  <BR>
+
  <BR>
+
  <BR>
+
</LI>
+
+
<LI>
+
  
right click on Paper and select 'Set Type'->'New..." to create a new type for the element.<BR>
+
  8. In the symbol String entry field, enter ibm, then click on Go . In the Status pane, you should see an answer like this:
  [[Image:Xsdeditor-figure4.JPG]]
+
  <BR>
+
  <BR>
+
  <BR>
+
+
</LI>
+
+
<LI>select 'Complex Type' and check 'Create as anonymous type'. Click 'OK'.<BR>
+
 
+
[[Image:Xsdeditor-figure5.JPG]]
+
  <BR> 
+
  <BR>
+
  <BR>
+
</LI>
+
+
<LI>
+
Double click on 'Paper' to explore this element, note that 'PaperType'
+
is surrounded by parenthesis to indicate anonymity of this type. Click on this type to invoke the
+
properties sheet for its. <BR>
+
 
+
<BR>
+
 
+
</LI>
+
  
<LI>
+
      return (float): 79.28
On the Properties sheet, select the 'Inherit From:' combo and then select 'Browse...' as shown below.
+
+
  [[Image:Xsdeditor-figure6.JPG]]
+
  <BR>
+
  <BR>
+
  <BR> 
+
</LI>
+
   
+
<LI>
+
    The Set Type dialog will appear. Select 'PublicationType', and click OK.<BR>
+
   
+
[[Image:Xsdeditor-figure7.JPG]]
+
  <BR>
+
  <BR>
+
  <BR> 
+
</LI>
+
   
+
<LI>
+
    Double click on Paper's type to edit its structure as shown below. Then right click on the '(PaperType)' and select 'Add Element'<BR>
+
   
+
[[Image:xsdeditor-figure8.JPG]]
+
  <BR>
+
  <BR>
+
  <BR>
+
</LI>
+
 
+
<LI>
+
  Name the newly added element 'URL' because, say, the paper is found on the web.<BR>
+
   
+
[[Image:xsdeditor-figure9.JPG]]
+
  <BR>   
+
  <BR> 
+
  <BR>
+
</LI>
+
+
<LI>The type of URL can be changed in the main editor panel by clicking on its current type 'string'. A combo box will be shown as below (For now we don't change the the type of URL yet)
+
<BR>
+
   
+
[[Image:xsdeditor-figure10.JPG]]
+
    <BR>
+
    <BR>
+
  <BR>
+
</LI>
+
  
<LI>Right click on '(PaperType)', select 'Add Element Ref' to create element reference. Initally, the editor will pick a random element to be referred. In this case, it's 'Book'
+
      You may need to move the horizontal bar separating the Actions and Status panes upwards a bit to get a better view. Result:
as shown below.
+
  
<BR>
+
Explanation
   
+
[[Image:xsdeditor-figure11.JPG]]
+
    <BR>
+
    <BR>
+
  <BR>
+
</LI>
+
  
<LI>We can change the element to be referred to in the main editor panel by click on 'Book'. A Combo will be shown as below.
+
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.
 +
  
<BR>
+
The Web Services Explorer provides three key services to the user:
   
+
[[Image:xsdeditor-figure12.JPG]]
+
    <BR>
+
    <BR>
+
  <BR>
+
</LI>
+
  
<LI>
+
  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.
  
Now that we've finished editing the XML Schema you can save the file.
+
</LI>
+
  
</OL>
+
Note:
 
+
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>
 
</TABLE>

Revision as of 18:53, 25 January 2008

 

By Trung Ha
Jan 30, 2008


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 " Delayed Stock Quote " as available from XMethods 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:

Xsdeditor-figure1.JPG


4) In the Web Service Explorer's toolbar (top-right), click on the WSDL Page icon
5) Click on the WSDL Main icon. Result:


  6.  In the WSDL URL  field, enter the URL  http://services.xmethods.net/soap/urn:xmethods-delayed-quotes.wsdl , then click on Go  . Result:
  7. Under Operations in the right hand pane, click on getQuote. Result:
  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:

Explanation


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.


The Web Services Explorer provides three key services to the user:


  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.


Note: 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.

Back to the top