kprice | 6decb03 | 2008-04-01 19:05:41 +0000 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| 2 | <html lang="en-us" xml:lang="en-us"> |
| 3 | <head> |
| 4 | <meta content="text/html; charset=utf-8" http-equiv="Content-Type" /> |
| 5 | <meta name="copyright" content="Copyright (c) 2000, 2008 IBM Corporation and others. All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html. Contributors: IBM Corporation - initial API and implementation" /> |
| 6 | <meta name="DC.rights.owner" content="(C) Copyright 2000, 2008" /> |
| 7 | <meta content="public" name="security" /> |
| 8 | <meta content="index,follow" name="Robots" /> |
| 9 | <meta http-equiv="PICS-Label" content='(PICS-1.1 "http://www.icra.org/ratingsv02.html" l gen true r (cz 1 lz 1 nz 1 oz 1 vz 1) "http://www.rsac.org/ratingsv01.html" l gen true r (n 0 s 0 v 0 l 0) "http://www.classify.org/safesurf/" l gen true r (SS~~000 1))' /> |
| 10 | <meta content="task" name="DC.Type" /> |
| 11 | <meta name="DC.Title" content="Creating a Web service from a Java bean using the Apache Axis2 runtime environment" /> |
| 12 | <meta name="abstract" content="The Web Service wizard assists you in creating a new Web service, configuring it for deployment, and deploying the Web service to a server. Once your Web service is deployed, the wizard assists you in generating the client proxy and sample application to test the Web service. When you have completed testing, you can publish your Web service to a UDDI Business Registry using the Export wizard." /> |
| 13 | <meta name="description" content="The Web Service wizard assists you in creating a new Web service, configuring it for deployment, and deploying the Web service to a server. Once your Web service is deployed, the wizard assists you in generating the client proxy and sample application to test the Web service. When you have completed testing, you can publish your Web service to a UDDI Business Registry using the Export wizard." /> |
| 14 | <meta content="Axis2 runtime environment, Web services, Java beans, Axis2 runtime environment, creating a Web service" name="DC.subject" /> |
| 15 | <meta content="Axis2 runtime environment, Web services, Java beans, Axis2 runtime environment, creating a Web service" name="keywords" /> |
| 16 | <meta scheme="URI" name="DC.Relation" content="../topics/caxis2tover.html" /> |
| 17 | <meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.ws.doc.user/concepts/cwsinwsa.html" /> |
| 18 | <meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.ws.doc.user/concepts/cws.html" /> |
| 19 | <meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.ws.doc.user/tasks/toverws.html" /> |
| 20 | <meta scheme="URI" name="DC.Relation" content="../../org.eclipse.jst.ws.consumption.ui.doc.user/tasks/tuddiexp.html" /> |
| 21 | <meta content="XHTML" name="DC.Format" /> |
| 22 | <meta content="twsbeana" name="DC.Identifier" /> |
| 23 | <meta content="en-us" name="DC.Language" /> |
| 24 | <link href="../../org.eclipse.wst.doc.user/common.css" type="text/css" rel="stylesheet" /> |
| 25 | <title>Creating a Web service from a Java bean using the Apache Axis2 |
| 26 | runtime environment</title> |
| 27 | </head> |
| 28 | <body id="twsbeana"><a name="twsbeana"><!-- --></a> |
| 29 | |
| 30 | |
| 31 | <h1 class="topictitle1">Creating a Web service from a Java bean using the Apache Axis2 runtime |
| 32 | environment</h1> |
| 33 | |
| 34 | |
| 35 | |
| 36 | |
| 37 | <div><p>The Web Service wizard assists you in creating a new Web service, |
| 38 | configuring it for deployment, and deploying the Web service to a server. |
| 39 | Once your Web service is deployed, the wizard assists you in generating the |
| 40 | client proxy and sample application to test the Web service. When you have |
| 41 | completed testing, you can publish your Web service to a UDDI Business Registry |
| 42 | using the Export wizard.</p> |
| 43 | |
| 44 | <div class="p"><div class="p">Prerequisites:<ol> |
| 45 | <li id="twsbeana__installaxis2link"><a name="twsbeana__installaxis2link"><!-- --></a>You must have installed the Apache Axis2 runtime |
| 46 | environment as described in: <a href="caxis2tover.html" title="This runtime environment is for users who prefer to develop for the open Apache Axis platform. Both Axis1 and Axis2 are supported by the Web services tools.">Creating Web services with the Apache Axis2 runtime environments</a></li> |
| 47 | |
| 48 | <li id="twsbeana__createtomcatlink"><a name="twsbeana__createtomcatlink"><!-- --></a>If you are using the Apache Jakarta Tomcat servlet |
| 49 | container as your server, you must install it, configure an instance of it, |
kprice | b68e6af | 2008-05-15 22:17:35 +0000 | [diff] [blame] | 50 | and create a Web project targeted to it as described in: <a href="../../org.eclipse.jst.ws.axis.ui.doc.user/topics/ttomcatserv.html">Creating an Apache Tomcat server and Web project</a></li> |
kprice | 6decb03 | 2008-04-01 19:05:41 +0000 | [diff] [blame] | 51 | |
| 52 | <li>Create or import a bean into the Java™ source folder of the Web project. To |
| 53 | import, select the <strong>Java Resources: src</strong> folder, and from |
| 54 | the file menu select <span class="menucascade"><span class="uicontrol">Import</span> > <span class="uicontrol">General</span> |
| 55 | > <span class="uicontrol">File System</span></span> and browse to where your |
| 56 | package is.</li> |
| 57 | |
| 58 | </ol> |
| 59 | </div> |
| 60 | </div> |
| 61 | |
| 62 | <div class="section">To create a Web service from a bean using the Apache Axis2 runtime |
| 63 | environment:</div> |
| 64 | |
| 65 | <ol> |
kprice | 5454e8e | 2008-04-23 23:32:43 +0000 | [diff] [blame] | 66 | <li class="stepexpand"><span>Switch to the Java EE perspective (<span class="uicontrol">Window > Open Perspective |
| 67 | > Java EE</span>).</span></li> |
kprice | 6decb03 | 2008-04-01 19:05:41 +0000 | [diff] [blame] | 68 | |
| 69 | <li class="stepexpand"><span>In the Project Explorer view, select the bean that you created |
| 70 | or imported into the source folder of your Web project.</span></li> |
| 71 | |
| 72 | <li class="stepexpand"><span>Click <span class="uicontrol">File > New > Other</span>.</span> Select<span class="uicontrol">Web |
| 73 | Services</span> in order to display the various Web service wizards. |
| 74 | Select the <span class="uicontrol">Web Service</span> wizard. Click <span class="uicontrol">Next</span>. |
| 75 | </li> |
| 76 | |
| 77 | <li class="stepexpand"><span>Web Services page: select <span class="uicontrol">Bottom up Java bean Web service</span> as |
| 78 | your Web service type, and select the Java bean from which the service will be |
| 79 | created.</span> |
| 80 | <a name="twsbeana__createstep4ul"><!-- --></a><ol type="a" id="twsbeana__createstep4ul"> |
| 81 | <li class="substepexpand"><span>Select the stages of Web services development that you want |
| 82 | to complete using the slider:</span> <ul> |
| 83 | <li>Develop: this will develop the WSDL definition and implementation of the |
| 84 | Web service. This includes such tasks as creating the modules which will contain |
| 85 | the generated code, WSDL files, deployment descriptors, and Java files |
| 86 | when appropriate.</li> |
| 87 | |
| 88 | <li>Assemble: this ensures the project that will host the Web service or client |
| 89 | gets associated to an EAR when required by the target application server.</li> |
| 90 | |
| 91 | <li>Deploy: this will create the deployment code for the service.</li> |
| 92 | |
| 93 | <li>Install: this will install and configure the Web module and EARs on the |
| 94 | target server.</li> |
| 95 | |
| 96 | <li>Start: this will start the server once the service has been installed |
| 97 | on it. The server-config.wsdd file will be generated.</li> |
| 98 | |
| 99 | <li>Test: this will provide various options for testing the service, such |
| 100 | as using the Web Service Explorer or sample JSPs.</li> |
| 101 | |
| 102 | </ul> |
| 103 | </li> |
| 104 | |
| 105 | <li class="substepexpand"><span>Select your server: the default server is displayed. If you |
| 106 | want to deploy your service to a different server click the link to specify |
| 107 | a different server.</span></li> |
| 108 | |
| 109 | <li class="substepexpand"><span>Select your runtime: ensure the Apache Axis2 runtime is selected.</span> |
| 110 | </li> |
| 111 | |
| 112 | <li class="substepexpand"><span>Select the service project: the project selected in your workspace |
| 113 | is displayed. To select a different project click on the project link. If |
| 114 | you are deploying to WebSphere<sup>®</sup> Application Server you will also be asked |
| 115 | to select the EAR associated with the project.</span> Ensure that the |
| 116 | project selected as the Client Web Project is different from the Service Web |
| 117 | Project, or the service will be overwritten by the client's generated artifacts. |
| 118 | </li> |
| 119 | |
| 120 | <li class="substepexpand"><span>If you want to create a client, select the type of proxy to |
| 121 | be generated and repeat the above steps for the client.</span></li> |
| 122 | |
| 123 | <li class="substepexpand"><span>Publish the Web service: this will launch the Web Services Explorer |
| 124 | to publish your Web service to a UDDI registry.</span></li> |
| 125 | |
| 126 | <li class="substepexpand"><span>Monitor the Web service: this will send the Web service traffic |
| 127 | through the TCP/IP Monitor, which allows you to watch the SOAP traffic generated |
| 128 | by the Web service and to test this traffic for WS-I compliance. Alternately |
| 129 | you can manually set up a TCP/IP monitor as described in <a href="../../org.eclipse.wst.wsi.ui.doc.user/tasks/tmonitor.html">Using the TCP/IP Monitor to test Web services</a></span></li> |
| 130 | |
| 131 | </ol> |
| 132 | |
| 133 | </li> |
| 134 | |
| 135 | <li class="stepexpand"><span>Axis2 Web Service Java Bean Configuration page: If you have |
| 136 | a custom services.xml file you can point to it on this page, or you can have |
| 137 | the wizard create a default services.xml file for you.</span></li> |
| 138 | |
| 139 | <li class="stepexpand"><span>Web Service Test page: If you selected to test the Web service, |
| 140 | select the test facility for the generated Web service.</span> This will |
| 141 | open the Web service in the Web Services Explorer. Select the operation you |
| 142 | want to test, enter the required information, and click<span class="uicontrol">Go</span>. |
| 143 | The result will display in the Status pane. Click <span class="uicontrol">Next</span>. |
| 144 | </li> |
| 145 | |
| 146 | <li class="stepexpand" id="twsbeana__axis2clientpagelink"><a name="twsbeana__axis2clientpagelink"><!-- --></a><span>Axis2 Client Web service configuration |
| 147 | page: Use this page to select the following options: </span> |
| 148 | <ol type="a"> |
| 149 | <li><span>Service Name: accept the default.</span></li> |
| 150 | |
| 151 | <li><span>Port Name: accept the default.</span></li> |
| 152 | |
| 153 | <li><span>Databinding Name: only the Axis2 Databinding Framework (ADB) |
| 154 | is supported at this time.</span></li> |
| 155 | |
| 156 | <li><span>Custom package name: You can change the package name in this |
| 157 | field.</span></li> |
| 158 | |
| 159 | <li><span>Client mode: You can choose if the client is synchronous, asynchronous, |
| 160 | or both.</span></li> |
| 161 | |
| 162 | <li><span>Generate test case to test the service: If you select this, |
| 163 | the Axis2 emitter will generate JUnit testcases matching the WSDL provided |
| 164 | to the client. These JUnit testcases will be generated to a newly added source |
| 165 | directory to the client project called <span class="uicontrol">test</span>. </span> |
| 166 | </li> |
| 167 | |
| 168 | <li><span>Generate all types for all elements referred by schemas</span> |
| 169 | </li> |
| 170 | |
| 171 | <li><span>Namespace to package mapping: Use this table to review or edit |
| 172 | the mappings between packages and namespaces.</span></li> |
| 173 | |
| 174 | </ol> |
| 175 | |
| 176 | </li> |
| 177 | |
| 178 | <li class="stepexpand"><span>Web Service Client Test page: Use this page to select the following |
| 179 | options: </span> |
| 180 | <ol type="a"> |
| 181 | <li><span>Select your test facility. You can test the generated proxy |
| 182 | in the Web Service Explorer, or the Universal Test Client.</span></li> |
| 183 | |
| 184 | <li><span>Select <span class="uicontrol">Run test on server</span> to start the |
| 185 | server for you automatically.</span></li> |
| 186 | |
| 187 | </ol> |
| 188 | |
| 189 | </li> |
| 190 | |
| 191 | <li class="stepexpand"><span>Web Service Publication page: Select whether or not you want to |
| 192 | publish this Web service to a UDDI registry. Click <span class="uicontrol">Finish</span>.</span> |
| 193 | </li> |
| 194 | |
| 195 | </ol> |
| 196 | |
| 197 | <div class="section" id="twsbeana__axiswscreateresult"><a name="twsbeana__axiswscreateresult"><!-- --></a><div class="p">After the Web service has been created, |
| 198 | the following may occur depending on the options you selected: <ul> |
| 199 | <li>If you have selected to test the Web service using the Web Services Explorer, |
| 200 | the Explorer will open. Select the operation you want to test, enter the required |
| 201 | information, and click <strong>Go</strong>. The result will display in the Status pane.</li> |
| 202 | |
| 203 | <li>If you have selected to publish the Web service, the Web Services Explorer |
| 204 | is launched displaying the page required to publish your Web service. Follow |
| 205 | the instructions in <var class="varname">Publishing the Web service</var> to complete |
| 206 | this task.</li> |
| 207 | |
| 208 | </ul> |
| 209 | </div> |
| 210 | </div> |
| 211 | |
| 212 | <div class="section"><p> <span class="uicontrol">Important:</span> If your methods contain types, |
| 213 | not supported by the sample, such as arrays, indexed properties, and collections, |
| 214 | the methods will be omitted from the sample and you will receive a warning |
| 215 | message.</p> |
| 216 | </div> |
| 217 | |
| 218 | </div> |
| 219 | |
kprice | b68e6af | 2008-05-15 22:17:35 +0000 | [diff] [blame] | 220 | <div> |
| 221 | <div class="familylinks"> |
| 222 | <div class="parentlink"><strong>Parent topic:</strong> <a href="../topics/caxis2tover.html" title="This runtime environment is for users who prefer to develop for the open Apache Axis platform. Both Axis1 and Axis2 are supported by the Web services tools.">Creating Web services with the Apache Axis2 runtime environments</a></div> |
kprice | 6decb03 | 2008-04-01 19:05:41 +0000 | [diff] [blame] | 223 | </div> |
| 224 | |
| 225 | <div class="linklist"><strong>Related Concepts</strong><br /> |
| 226 | |
| 227 | <div><a href="../../org.eclipse.jst.ws.doc.user/concepts/cwsinwsa.html"> Tools for Web services development</a></div> |
| 228 | <div><a href="../../org.eclipse.jst.ws.doc.user/concepts/cws.html">Web services development</a></div></div> |
| 229 | |
| 230 | <div class="linklist"><strong>Related Tasks</strong><br /> |
| 231 | |
| 232 | <div><a href="../../org.eclipse.jst.ws.doc.user/tasks/toverws.html"> Developing Web services</a></div> |
| 233 | <div><a href="../../org.eclipse.jst.ws.consumption.ui.doc.user/tasks/tuddiexp.html"> Using the Web Services Explorer</a></div></div> |
| 234 | </div> |
| 235 | |
| 236 | </body> |
| 237 | </html> |