| <?xml version="1.0" encoding="utf-8"?> |
| <!--Arbortext, Inc., 1988-2005, v.4002--> |
| <!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd"> |
| <task id="tsampappa" xml:lang="en-us"> |
| <title>Generating a <tm tmclass="special" tmowner="Sun Microsystems, Inc." |
| tmtype="tm" trademark="Java">Java</tm> client proxy and a sample application |
| from a WSDL document using the Axis run-time environment</title> |
| <titlealts> |
| <searchtitle>Generating a Java client proxy and a sample application from |
| a WSDL document using the Axis run-time environment</searchtitle> |
| </titlealts> |
| <shortdesc>The Web Service Client wizard assists you in generating a <tm tmclass="special" |
| tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> bean |
| proxy and a sample application. The sample Web application demonstrates how |
| to code a proxy file.</shortdesc> |
| <taskbody> |
| <prereq><p>Prerequisites:</p><ol> |
| <li conref="tsklwsdla.dita#tsklwsdla/createtomcatlink"></li> |
| <li>Discover and import a WSDL document into the Web project. You can only |
| use a WSDL file that contains a service element.</li> |
| </ol></prereq> |
| <context>To generate a <tm tmclass="special" tmowner="Sun Microsystems, Inc." |
| tmtype="tm" trademark="Java">Java</tm> client proxy and a sample application |
| from a discovered WSDL document:</context> |
| <steps> |
| <step><cmd>Switch to the J2EE perspective (<uicontrol>Window > Open Perspective |
| > J2EE</uicontrol>).</cmd></step> |
| <step><cmd>In the Navigator view, select the Web project in which you want |
| to generate a sample application.</cmd></step> |
| <step><cmd>Click <uicontrol>File > New > Other</uicontrol>. Select <uicontrol>Web |
| Services</uicontrol> in order to display the various Web service wizards. |
| Select the <uicontrol>Web Service Client</uicontrol> wizard. Click <uicontrol>Next</uicontrol>.</cmd> |
| </step> |
| <step><cmd>Web Services page: Select the type of proxy to be generated, and |
| whether or not it will be tested.</cmd></step> |
| <step><cmd>Client Environment Configuration page: Select the run-time environment |
| and the server for your Web service client.</cmd> |
| <substeps> |
| <substep><cmd>Click <uicontrol>Explore Options</uicontrol> and select the |
| Apache Axis run-time environment and select the server on which you want to |
| run your Web service client.</cmd></substep> |
| <substep><cmd>Select the type and name of project in which you want the Web |
| service client created.</cmd><info><ul> |
| <li> If you enter the name of an existing project, the project type field |
| must match that of the existing project. Ensure that the project selected |
| as the Client Web Project is different from the Service Web Project, or the |
| service will be overwritten by the client's generated artifacts.</li> |
| <li>If you enter a name of a project that does not already exist, the wizard |
| will create the project for you.</li> |
| <li>Note that the only project type supported for Axis clients is a Web project. |
| If you want the client to be created in a <tm tmclass="special" tmowner="Sun Microsystems, Inc." |
| tmtype="tm" trademark="Java">Java</tm>, EJB, or Application Client project, |
| you must select the <tm tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" |
| trademark="WebSphere">WebSphere</tm> run-time environment for your client.</li> |
| </ul></info></substep> |
| </substeps> |
| </step> |
| <step><cmd>Web Service Selection page: Enter the URI to the WSDL, WSIL, or |
| HTML file that will be used to generate the client. You can optionally generate |
| a WSIL file from this file as well.</cmd></step> |
| <step><cmd>Web Service Proxy page: This panel shows the options for the proxy. |
| It lists the folder where the proxy will be generated, and you can optionally |
| create custom mappings between namespaces and packages.</cmd></step> |
| <step><cmd>Web Service Namespace to Package Mappings page: if you selected |
| <uicontrol>Define custom mapping for namespace to package</uicontrol> on |
| the previous page, you can enter your custom mapping pairs on this page by |
| clicking <uicontrol>Add</uicontrol>.</cmd></step> |
| <step><cmd>Web Service Client Test page: Select the test facility that you |
| will use to test the proxy, and the methods that you want included in the |
| proxy. Note that the Universal Test Client (UTC) is only compatible with Web |
| service clients deployed on <tm tmclass="ibm" tmowner="IBM Corporation" tmtype="reg" |
| trademark="WebSphere">WebSphere</tm> servers.</cmd></step> |
| <step><cmd>Click <uicontrol>Finish</uicontrol>. If you have selected to test |
| the proxy, the test client will open in a browser window.</cmd></step> |
| </steps> |
| <result><p>The generated <tm tmclass="special" tmowner="Sun Microsystems, Inc." |
| tmtype="tm" trademark="Java">Java</tm> bean proxy provides a remote procedure |
| call interface to the Web service. The sample Web application demonstrates |
| how to code the proxy file.</p><p>Once you have generated your <tm tmclass="special" |
| tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> client |
| proxy, you may test the methods of the Web service through the proxy using |
| Web Services sample JSPs or the Universal test client.</p><ul> |
| <li>If you have selected to test the generated proxy using Web service JSPs, |
| the proxy is launched in a Web browser at the following URL: <codeph>http://localhost: <varname>port</varname>/ <varname>WebProject</varname>Client/sample<i |
| >BeanName</i>/ <varname>WebServiceName</varname>/TestClient.jsp</codeph> You |
| can use this sample application to test the Web service by selecting a method, |
| entering a value for the method, and clicking <uicontrol>Invoke</uicontrol>. |
| The result of the method will display in the results pane.</li> |
| <li>If you have selected to test the generated proxy using the Universal Test |
| Client, it will be launched in a browser window at the following URL: <systemoutput>http://localhost:9080/UTC/preload?object= <varname>BeanPackage</varname |
| >. <varname>BeanServiceProxy</varname></systemoutput>. In the Reference pane, |
| under Object References, expand the proxy stub to display the methods of the |
| Web service. Click the method you want to test, enter a value in the Parameters |
| pane, and click <uicontrol>Invoke</uicontrol>. The result will be generated |
| below.</li> |
| <li>If you have selected to test the Web service using the Web Services Explorer, |
| the Explorer will open. Select the operation you want to test, enter the required |
| information, and click <b>Go</b>. The result will display in the Status pane.</li> |
| </ul><p>For more information on creating a Web project, refer to the Web application |
| development documentation.</p></result> |
| </taskbody> |
| <related-links> |
| <linklist><title>Related Concepts</title> |
| <link href="../../org.eclipse.jst.ws.doc.user/concepts/cwsinwsa.dita" scope="peer"> |
| <linktext> Tools for Web services development</linktext></link> |
| <link href="../../org.eclipse.jst.ws.doc.user/concepts/cws.dita" scope="peer"> |
| <linktext>Web services development</linktext></link> |
| </linklist> |
| <linklist><title>Related Tasks</title> |
| <link href="../../org.eclipse.jst.ws.consumption.ui.doc.user/tasks/tuddiexp.dita" |
| scope="peer"><linktext> Using the Web Services Explorer</linktext></link> |
| </linklist> |
| <linklist><title>Related Reference</title> |
| <link href="../../org.eclipse.jst.ws.doc.user/ref/rwsdl.dita" scope="peer"> |
| <linktext>WSDL documents</linktext></link> |
| </linklist> |
| </related-links> |
| </task> |