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"

 
(22 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<TABLE WIDTH="800" CELLSPACING=12 align=center>
+
{| width="100%" cellspacing="5" cellpadding="2"
<tr>
+
| width="60%" align="left" | <font class="indextop">Using Web Service Explorer to test a Web service</font><br />
<td valign="top" align="right">&nbsp;</td><td valign="top">
+
| width="40%" |
 +
[[Image:Wtplogosmall.png]]
 +
|}
  
<b>By Trung Ha</b>
+
{| width="100%" cellspacing="5" cellpadding="2"
<BR>
+
| valign="top" | '''By Kathy Chan'''<br /> June 23, 2008 <br /><br />
Jan 30, 2008<BR>
+
|-
 
+
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | ''' <font color="#ffffff" face="Arial,Helvetica">Introduction</font>'''
<BR>
+
|-
 
+
| valign="top" | <br />
'''Introduction'''
+
|-
<P>  
+
| valign="top" | 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 drivers (it works with WTP 1.5.x, WTP 2.0.x, 3.0.x, and WTP 3.2).
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.
+
|-
</P>
+
| valign="top" |
<P>
+
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 " [http://www.xmethods.net/ve2/ViewListing.po?key=uuid:BF3EFCDD-FCD4-8867-3AAC-068985E7CB89  Romulan Numbers XLII ]" as available from [http://www.xmethods.net/ XMethods] on the internet.
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.
+
|-
</P>
+
| valign="top" | 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.
<P>
+
|-
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.  
+
| valign="top" | <br />
</P>
+
|-
 
+
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | ''' <font color="#ffffff" face="Arial,Helvetica">Using the Web Services Explorer to test a Web service</font>'''
<BR>
+
|-
<BR>
+
| valign="top" | <br />
'''Using the Web Services Explorer to test a Web service'''
+
|-
<P>
+
| valign="top" |
1) Launch the Eclipse WTP workbench.
+
# 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.
+
# 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: <BR>
+
# After the Web Browser view opens, maximize it. Result: <br />[[Image:wse_uddi.JPG]]
 
+
# In the Web Service Explorer's toolbar (top-right), click on the ''' WSDL Page''' icon, <br />[[Image:wsdl.jpg]]<br />
<BR>
+
# Click on the [[Image:wsdl_main.gif]] '''WSDL Main''' icon. Result: <br />[[Image:wse_wsdl.JPG]]
 
+
# In the '''WSDL URL''' field, enter the URL <tt>http://www.ebob42.com/cgi-bin/Romulan.exe/wsdl/IRoman </tt>, then click on '''Go''' . Result: <br />[[Image:wse_romanConvert.JPG]]
[[Image:Xsdeditor-figure1.JPG]]
+
# Under '''Operations''' in the right hand pane, click on '''IntToRoman'''. Result: <br />[[Image:wse_romanConvertIntToRoman.JPG]]
</P>
+
# In the '''Int int''' entry field, enter <tt>9</tt>, then click on '''Go''' . In the '''Status''' pane, you should see an answer like this: <br />'''return (String) IX
 
+
|-
 
+
| valign="top" |
<P>In order to see these components in detail you can 'drill down' on a component of interest by double clicking on it. For example,  
+
[[Image:note.gif|Note: ]]<br /> 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
if we double click on the 'BookType' component, the editor will display the structure of the 'BookType' type as shown below.
+
|}
To return to the 'top-level' view, press the back button
+
[[Image:Xsdeditor-toplevelbutton.JPG]]
+
at the top left of the editor, or right clicking within the editor and selecting 'Back to Schema' from the context menu.<BR>
+
 
+
<BR>
+
[[Image:Xsdeditor-figure2.JPG]]
+
</P>
+
<BR>
+
 
+
<P>Editing the schema is achieved by invoking context menu actions on selected objects in the Graph view and
+
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>
+
+
<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>
+
  [[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>
+
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'  
+
as shown below.
+
 
+
<BR>
+
   
+
[[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.
+
 
+
<BR>
+
   
+
[[Image:xsdeditor-figure12.JPG]]
+
    <BR>
+
    <BR>
+
  <BR>
+
</LI>
+
 
+
<LI>
+
 
+
Now that we've finished editing the XML Schema you can save the file.
+
</LI>
+
 
+
</OL>
+
 
+
</td>
+
</tr>
+
 
+
</TABLE>
+

Latest revision as of 10:29, 13 May 2010

Using Web Service Explorer to test a Web service

Wtplogosmall.png

By Kathy Chan
June 23, 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 drivers (it works with WTP 1.5.x, WTP 2.0.x, 3.0.x, and WTP 3.2).

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 " Romulan Numbers XLII " 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:
    Wse uddi.JPG
  4. In the Web Service Explorer's toolbar (top-right), click on the WSDL Page icon,
    Wsdl.jpg
  5. Click on the Wsdl main.gif WSDL Main icon. Result:
    Wse wsdl.JPG
  6. In the WSDL URL field, enter the URL http://www.ebob42.com/cgi-bin/Romulan.exe/wsdl/IRoman , then click on Go . Result:
    Wse romanConvert.JPG
  7. Under Operations in the right hand pane, click on IntToRoman. Result:
    Wse romanConvertIntToRoman.JPG
  8. In the Int int entry field, enter 9, then click on Go . In the Status pane, you should see an answer like this:
    return (String) IX

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