blob: 788084cd3eb2a1a1854c75800e97e549d812fbef [file] [log] [blame]
kprice6decb032008-04-01 19:05:41 +00001<?xml version="1.0" encoding="utf-8"?>
2<!--Arbortext, Inc., 1988-2006, v.4002-->
4 "task.dtd">
5<?Pub Inc?>
6<task id="tsampappa" xml:lang="en-us">
7<title>Generating a <tm tmclass="special" tmowner="Sun Microsystems, Inc."
8tmtype="tm" trademark="Java">Java</tm> client proxy and a sample application
9from a WSDL document using the Axis2 runtime environment</title>
11<searchtitle>Generating an Apache Axis2 Java client proxy from a WSDL document</searchtitle>
13<shortdesc>The Web Service Client wizard assists you in generating a <tm tmclass="special"
14tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> bean
15proxy and a sample application. The sample Web application demonstrates how
16to code a proxy file.</shortdesc>
18<keywords><indexterm>Axis2 runtime environment<indexterm>Web service clients</indexterm></indexterm>
19<indexterm>Web services<indexterm>Axis2 runtime environment<indexterm>Web
20service clients</indexterm></indexterm></indexterm></keywords>
24<li conref="taxis2bu.dita#twsbeana/installaxis2link"></li>
25<li conref="taxis2bu.dita#twsbeana/createtomcatlink"></li><?Pub Caret?>
26<li>Discover and import a WSDL document into the Web project. You can only
27use a WSDL file that contains a service element.</li>
29<context>To generate a <tm tmclass="special" tmowner="Sun Microsystems, Inc."
30tmtype="tm" trademark="Java">Java</tm> client proxy and a sample application
31from a discovered WSDL document:</context>
33<step><cmd>Switch to the J2EE perspective (<uicontrol>Window > Open Perspective
34> J2EE</uicontrol>).</cmd></step>
35<step><cmd>In the Navigator view, select the Web project in which you want
36to generate a sample application.</cmd></step>
37<step><cmd>Click <uicontrol>File > New > Other</uicontrol>. Select <uicontrol>Web
38Services</uicontrol> in order to display the various Web service wizards.
39Select the <uicontrol>Web Service Client</uicontrol> wizard. Click <uicontrol>Next</uicontrol>.</cmd>
41<step><cmd>Web Services page: </cmd>
43<substep><cmd>Enter the URI to the WSDL, WSIL, or HTML file that will be used
44to generate the client.</cmd></substep>
45<substep><cmd>Select the type of proxy to be generated</cmd></substep>
46<substep><cmd>Select the stages of Web services development that you want
47to complete using the slider:</cmd><info><ul>
48<li>Develop: this will develop the WSDL definition and implementation of the
49Web service. This includes such tasks as creating the modules which will contain
50the generated code and <tm tmclass="special" tmowner="Sun Microsystems, Inc."
51tmtype="tm" trademark="Java">Java</tm> files, as well as copying the Axis
53<li>Assemble: this ensures the project that will host the Web service or client
54gets associated to an EAR when required by the target application server.</li>
55<li>Deploy: this will create the deployment code for the service.</li>
56<li>Install: this will install and configure the Web module and EARs on the
57target server.</li>
58<li>Start: this will start the server once the service has been installed
59on it. The server-config.wsdd file will be generated.</li>
60<li>Test: this will provide various options for testing the service, such
61as using the Web Service Explorer or sample JSPs.</li>
63<substep><cmd>Select your server: the default server is displayed. If you
64want to deploy your client to a different server click the link to specify
65a different server.</cmd></substep>
66<substep><cmd>Select your runtime: ensure the Apache Axis2 runtime is selected.</cmd>
68<substep><cmd>Select the client project: the project containing the project
69selected in your workspace is displayed. To select a different project and
70EAR click on the project link.</cmd><info>Ensure that the project selected
71as the Client Web Project is different from the Service Web Project, or the
72service will be overwritten by the client's generated artifacts.</info></substep>
73<substep><cmd>Monitor the Web service: this will send the Web service traffic
74through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated
75by the Web service and to test this traffic for WS-I compliance. Alternately
76you can manually set up a TCP/IP monitor as described in <xref href="../../org.eclipse.wst.wsi.ui.doc.user/tasks/tmonitor.dita"
77scope="peer">Using the TCP/IP Monitor to test Web services</xref></cmd></substep>
80<step conref="taxis2bu.dita#twsbeana/axis2clientpagelink"><cmd>Axis2 Client
81Web service configuration page: Use this page to select the following options: </cmd>
83<substep><cmd>Service Name: </cmd></substep>
84<substep><cmd>Port Name: </cmd></substep>
85<substep><cmd>Databinding Name: Only the Axis2 Databinding Framework (ADB)
86is supported at this time.</cmd></substep>
87<substep><cmd>Custom package name: You can change the package name in this
89<substep><cmd>Client mode: You can choose if the client is synchronous, asynchronous,
90or both.</cmd></substep>
91<substep><cmd>Generate test case to test the service: If you select this,
92the Axis2 emitter will generate JUnit testcases matching the WSDL provided
93to the client. These JUnit testcases will be generated to a newly added source
94directory to the client project called <uicontrol>test</uicontrol>. </cmd>
96<substep><cmd>Generate all types for all elements referred by schemas:</cmd>
98<substep><cmd>Namespace to package mapping: Use this table to review or edit
99the mappings between packages and namespaces.</cmd></substep>
102<step><cmd>Web Service Client Test page: Use this page to select the following
103options: </cmd>
105<substep><cmd>Select your test facility. You can test the generated proxy
106in the Web Service Explorer, or the Universal Test Client.</cmd></substep>
107<substep><cmd>Select <uicontrol>Run test on server</uicontrol> to start the
108server for you automatically.</cmd></substep>
111<step><cmd>Click <uicontrol>Finish</uicontrol>. If you have selected to test
112the proxy, the test client will open in a browser window.</cmd></step>
114<result><p>The generated <tm tmclass="special" tmowner="Sun Microsystems, Inc."
115tmtype="tm" trademark="Java">Java</tm> bean proxy provides a remote procedure
116call interface to the Web service. The sample Web application demonstrates
117how to code the proxy file.</p><p>Once you have generated your <tm tmclass="special"
118tmowner="Sun Microsystems, Inc." tmtype="tm" trademark="Java">Java</tm> client
119proxy, you may test the methods of the Web service through the proxy using
120Web Services sample JSPs or the Universal test client.</p><ul outputclass="wsclienttestoptions">
121<li>If you have selected to test the generated proxy using Web service JSPs,
122the proxy is launched in a Web browser at the following URL: <codeph>http://localhost: <varname>port</varname>/ <varname>WebProject</varname>Client/sample<i
123>BeanName</i>/ <varname>WebServiceName</varname>/TestClient.jsp</codeph> You
124can use this sample application to test the Web service by selecting a method,
125entering a value for the method, and clicking <uicontrol>Invoke</uicontrol>.
126The result of the method will display in the results pane.</li>
127<li>If you have selected to test the Web service using the Web Services Explorer,
128the Explorer will open. Select the operation you want to test, enter the required
129information, and click <b>Go</b>. The result will display in the Status pane.</li>
130</ul><p>For more information on creating a Web project, refer to the Web application
131development documentation.</p></result>
134<linklist><title>Related Concepts</title>
135<link href="../../" scope="peer">
136<linktext> Tools for Web services development</linktext></link>
137<link href="../../" scope="peer">
138<linktext>Web services development</linktext></link>
140<linklist><title>Related Tasks</title>
141<link href="../../"
142scope="peer"><linktext> Using the Web Services Explorer</linktext></link>
146<?Pub *0000008334?>