| <?xml version="1.0" encoding="utf-8"?> | |
| <!--Arbortext, Inc., 1988-2006, v.4002--> | |
| <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" | |
| "task.dtd"> | |
| <task id="ttdwsa" xml:lang="en-us"> | |
| <title>Creating a Web service using Ant tasks in the Workbench</title> | |
| <titlealts> | |
| <searchtitle>Creating an Axis runtime Web service using Ant tasks in the Workbench</searchtitle> | |
| </titlealts> | |
| <shortdesc>You can use Ant through the Eclipse workspace to generate a Web | |
| service using the Axis run-time environment. Both top-down and bottom-up Web | |
| services development is supported with the Ant tasks.</shortdesc> | |
| <prolog><metadata> | |
| <keywords><indexterm>Axis runtime environment<indexterm>Web services<indexterm>creating | |
| with Ant tasks</indexterm></indexterm></indexterm><indexterm>Web services<indexterm>Axis | |
| runtime environment<indexterm>Web services<indexterm>creating with Ant tasks</indexterm></indexterm></indexterm></indexterm> | |
| </keywords> | |
| </metadata></prolog> | |
| <taskbody> | |
| <prereq>Before creating the Web service you must:<ul> | |
| <li>complete the prerequisites listed in: <xref href="cwsaxisant.dita"></xref></li> | |
| <li>if you are creating a top-down Web service, create or import a WSDL file | |
| into the <userinput>WebContent</userinput> folder of the dynamic Web project | |
| you created.</li> | |
| <li>If you are creating a bottom-up Web service, create or import a Java bean | |
| into the <userinput>src</userinput> folder of the dynamic Web project.</li> | |
| </ul></prereq> | |
| <context>In order to create the Web service you need to modify the Ant file | |
| and the service Ant properties file.</context> | |
| <steps> | |
| <step><cmd>Edit the Ant file (<userinput>axis_tdjava.xml</userinput> or <userinput>axis_bujava.xml</userinput>) | |
| that you imported in the prerequisite steps. Ensure that it points to the | |
| service Ant properties file: it should contain a line stating <userinput><property | |
| file="axis_tdjava.properties"/></userinput> or <userinput><property file="axis_bujava.properties"/></userinput>.</cmd> | |
| <info>Save any changes that you have made.</info></step> | |
| <step><cmd>Edit the properties file that you imported in the prerequisite | |
| steps.</cmd> | |
| <substeps> | |
| <substep><cmd>Ensure that the scenarioType parameter is set to service.</cmd> | |
| </substep> | |
| <substep><cmd>Set the workspace parameter so that it points to the location | |
| of your WSDL file or Java bean.</cmd></substep> | |
| <substep><cmd>All other parameters are optional and should be deleted if not | |
| explicitly set. The default values for the remaining parameters will be retrieved | |
| from the dynamic project settings and preferences. For additional information | |
| on how to set these parameters refer to: </cmd><info><ul> | |
| <li><xref href="rtdwsa.dita"></xref></li> | |
| <li><xref href="rbuwsa.dita"></xref></li> | |
| </ul></info></substep> | |
| </substeps> | |
| <info>Save the properties file.</info></step> | |
| <step><cmd>Right-click <userinput>axis_tdjava.xml</userinput> or <userinput>axis_bujava.xml</userinput> and | |
| select <menucascade><uicontrol>Run As</uicontrol><uicontrol>Ant Build...</uicontrol> | |
| </menucascade></cmd></step> | |
| <step><cmd>In the dialog that opens, select the <uicontrol>JRE</uicontrol> tab | |
| and select <uicontrol>Run in the same JRE as the workspace</uicontrol>.</cmd> | |
| <info>Click <uicontrol>Apply</uicontrol> and then click <uicontrol>Run</uicontrol>.</info> | |
| </step> | |
| <step><cmd>Once your Web service has been generated the console displays a <userinput>Build | |
| Successful</userinput> message.</cmd></step> | |
| </steps> | |
| <result>The WSDL file for the service will have been created and placed in | |
| the dynamic Web project's WebContent\wsdl folder. The following files will | |
| have been created and placed in a subdirectory of the dynamic Web project's | |
| WebContent\WEB-INF folder:<ul> | |
| <li>web.xml</li> | |
| <li>undeploy.wsdd</li> | |
| <li>deploy.wsdd </li> | |
| </ul>If you are creating a top-down Web service, Web service files similar | |
| to the following ones will be created and placed under the dynamic Web project's | |
| src folder. Depending on the WSDL file on which the Web service is based, | |
| the files for your Web service may be different:<ul> | |
| <li><i>Service_name</i>_PortType.java</li> | |
| <li><i>Service_name</i>_Service.java</li> | |
| <li><i>Service_name</i>_ServiceLocator.java</li> | |
| <li><i>Service_name</i>SOAPImpl.java</li> | |
| <li><i>Service_name</i>SOAPSkeleton.java</li> | |
| <li><i>Service_name</i>SOAPStub.java</li> | |
| </ul> </result> | |
| </taskbody> | |
| </task> |