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 "Creating a Top-Down Java Web Service Skeleton from a WSDL Document"

 
(3 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 
{| width="100%" cellspacing="5" cellpadding="2"
 
{| width="100%" cellspacing="5" cellpadding="2"
 
| valign="top" |
 
| valign="top" |
'''By Kathy Chan'''<br /> June 29, 2006 <br /><br />
+
'''By Kathy Chan'''<br /> June 23, 2008 <br /><br />
 
|-
 
|-
 
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | '''<font color="#ffffff" face="Arial,Helvetica">Introduction</font>'''
 
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | '''<font color="#ffffff" face="Arial,Helvetica">Introduction</font>'''
Line 8: Line 8:
 
|-
 
|-
 
| valign="top" |
 
| 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 the '''WTP 1.5''' drivers.
+
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 the WTP drivers (it works with WTP 1.5.x, WTP 2.0.x, 3.0.x, and WTP 3.2).
 
|-
 
|-
 
| valign="top" |
 
| valign="top" |
Line 29: Line 29:
 
|-
 
|-
 
| valign="top" |
 
| valign="top" |
# Import the file [srcfiles/AreaService.wsdl AreaService.wsdl] into AreaProj/WebContent.
+
# Import the file [http://www.eclipse.org/webtools/jst/components/ws/1.5/tutorials/TopDownWebService/srcfiles/AreaService.wsdl AreaService.wsdl] into AreaProj/WebContent.
 
# Select the '''AreaService.wsdl''' file.
 
# Select the '''AreaService.wsdl''' file.
 
# Open File -> New -> Other... -> Web Services -> Web Service.
 
# Open File -> New -> Other... -> Web Services -> Web Service.

Latest revision as of 10:13, 13 May 2010

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 the 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 create a simple top-down Web service from a WSDL file. The WSDL file in this scenario calculates the area of an rectangle.


Set Up

Before creating the Web service, there are two prerequisites:

  1. Install Apache Tomcat
  2. Create a dynamic Web project called AreaProj .
Create a top down Java bean Web service
  1. Import the file AreaService.wsdl into AreaProj/WebContent.
  2. Select the AreaService.wsdl file.
  3. Open File -> New -> Other... -> Web Services -> Web Service.
  4. Click Next
  5. In the Web service type combo, select Top down Java bean Web Service.
  6. Move the Service slider to the Start Service position.
  7. Result:
    Ws TDWizard.png
  8. If you want to choose a server different from the one defaulted by the wizard, click the Service project link to select a server
  9. Click Finish.
  10. 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 AreaServiceSOAPImpl.java will appear in the browser view. Fill in the expression parameters.getHeight()*parameters.getWidth() as the return value for the calculateRectArea method and save the file.
    Ws TDImpl.png

Follow the instructions at Creating Web Service Client to create a Web service client that you can then use to test this Web service.

Back to the top