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.
Difference between revisions of "Creating Web service and Web service client using Ant tasks"
Line 32: | Line 32: | ||
|- | |- | ||
| valign="top" | | | valign="top" | | ||
− | # [../InstallTomcat/InstallTomcat.html Install Apache Tomcat] | + | # [http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/InstallTomcat/InstallTomcat.html Install Apache Tomcat] |
− | # [../CreateWebProject/CreateWebProject.html Create a dynamic Web project] called '''testProject''' . | + | # [http://www.eclipse.org/webtools/jst/components/ws/1.0/tutorials/CreateWebProject/CreateWebProject.html Create a dynamic Web project] called '''testProject''' . |
|- | |- | ||
| colspan="2" bgcolor="#0080c0" align="left" valign="top" | '''<font color="#ffffff" face="Arial,Helvetica">Service Generation - Using the Ant Task inside Eclipse</font>''' | | colspan="2" bgcolor="#0080c0" align="left" valign="top" | '''<font color="#ffffff" face="Arial,Helvetica">Service Generation - Using the Ant Task inside Eclipse</font>''' | ||
Line 40: | Line 40: | ||
First, import the Ant files into the Eclipse workbench. | First, import the Ant files into the Eclipse workbench. | ||
# Within, WTP, create a simple project called '''AntTest'''. | # Within, WTP, create a simple project called '''AntTest'''. | ||
− | # Once you have created the simple project, use the main menu and select: '''File > New > Other > Web Services > Ant Files'''. Click '''Next'''. <br />[[Image: | + | # Once you have created the simple project, use the main menu and select: '''File > New > Other > Web Services > Ant Files'''. Click '''Next'''. <br />[[Image:Ws_antimport1.jpg]]<br /> |
− | # Browse to the '''AntTest''' project. <br />[[Image: | + | # Browse to the '''AntTest''' project. <br />[[Image:Ws_antimport2.jpg]]<br /> |
# Click '''Finish'''. | # Click '''Finish'''. | ||
# Under the '''Other Projects''' in the '''Project Explorer''' view, three files have been imported into the '''AntTest''' project folder: | # Under the '''Other Projects''' in the '''Project Explorer''' view, three files have been imported into the '''AntTest''' project folder: | ||
Line 60: | Line 60: | ||
# Save the '''axisservice.properties''' file. | # Save the '''axisservice.properties''' file. | ||
# Right click on the '''wsgen.xml''' file and select '''Run As > Ant Build...''' | # Right click on the '''wsgen.xml''' file and select '''Run As > Ant Build...''' | ||
− | # In the Ant dialog, click on the '''JRE''' tab and choose the radio button '''Run in the same JRE as the workspace'''. Click '''Apply''' and then '''Run'''<br />[[Image: | + | # In the Ant dialog, click on the '''JRE''' tab and choose the radio button '''Run in the same JRE as the workspace'''. Click '''Apply''' and then '''Run'''<br />[[Image:Ws_antdialog.jpg]]<br /> |
# Once the generation is complete, you will get a <tt>Build Successful</tt> message in the console. '''AreaServiceSOAP.wsdl''' should have been generated into the project's '''WebContent\wsdl''' folder as well as the Java code in the '''src''' folder for the '''testProject''' web project in the '''org.tempuri.AreaService''' package - | # Once the generation is complete, you will get a <tt>Build Successful</tt> message in the console. '''AreaServiceSOAP.wsdl''' should have been generated into the project's '''WebContent\wsdl''' folder as well as the Java code in the '''src''' folder for the '''testProject''' web project in the '''org.tempuri.AreaService''' package - | ||
#* AreaService_PortType.java | #* AreaService_PortType.java |
Revision as of 23:57, 28 February 2008
Running Web service scenarios using Ant |
By Joan Haggarty | |
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 with the WTP 1.0 drivers. | |
This tutorial shows how to run Web services scenarios (top down web service, bottom up web service and client generation) without the web service wizard by way of an Ant task. | |
The Ant task can be invoked in one of two ways:
| |
Set up | |
| |
Before creating the Web service, there are two prerequisites: | |
| |
Service Generation - Using the Ant Task inside Eclipse | |
First, import the Ant files into the Eclipse workbench.
| |
Next, import the sample WSDL file [srcfiles/AreaService.wsdl AreaService.wsdl] file into the WebContent folder of the dynamic web project testProject. | |
No matter where the task is invoked, required input needs to be provided to the Ant task by way of properties and a reference to the properties file updated from the Ant file. The properties file must specify the resource that will be used to generate the service. In this example, we will point to the AreaService.wsdl file in the testProject web project. The type of scenario needs to be specified as well. In this case, the scenario will be | |
| |
Note: | |
InitialSelection | |
| |
Client Generation - Using the Ant Task at the Command Line | |
Typically, you would use either the Eclipse or the command line mechanism to invoke the Ant task, not both. However, for the purposes of showing how the Ant tasks can be invoked, we'll switch out to the command line to demonstrate generating the client code. The next task is to generate a client for the AreaService web service using the same project and the WSDL file generated using the wsgen Ant task within Eclipse earlier. | |
|