Notice: This Wiki is now read only and edits are no longer possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.
Difference between revisions of "Creating a top-down Axis2 Web service"
Line 38: | Line 38: | ||
# Create a folder called WSDL on the Axis2WSTest project. Import the file [code/AreaService.wsdl AreaService.wsdl] into Axis2WSTest/wsdl.<br />[[Image:Ws_tdAxis2WsdlFile.png]]<br />Build the Project, if its not auto build. | # Create a folder called WSDL on the Axis2WSTest project. Import the file [code/AreaService.wsdl AreaService.wsdl] into Axis2WSTest/wsdl.<br />[[Image:Ws_tdAxis2WsdlFile.png]]<br />Build the Project, if its not auto build. | ||
# Now we are going to invoke the web service creation wizard with respect to the newly imported WSDL. By selecting AreaService.wsdl source the Open File -> New -> Other... -> Web Services -> Web Service<br />[[Image:Ws_buAxis2newWebService.png]]<br />Click next | # Now we are going to invoke the web service creation wizard with respect to the newly imported WSDL. By selecting AreaService.wsdl source the Open File -> New -> Other... -> Web Services -> Web Service<br />[[Image:Ws_buAxis2newWebService.png]]<br />Click next | ||
− | # Because of the wizard was invoked related to a correct WSDL the correct web services scenario will be picked automatically with the correct service definition. Also the configuration must be automatically set to the correct server, web service runtime and the service project. Make sure that you have selected the scale until to the start service. Also make sure you have the exact same items for the Server, Web Service Runtime and Service Project. Else make appropriate changes to select them as displayed below.<br />[[Image: | + | # Because of the wizard was invoked related to a correct WSDL the correct web services scenario will be picked automatically with the correct service definition. Also the configuration must be automatically set to the correct server, web service runtime and the service project. Make sure that you have selected the scale until to the start service. Also make sure you have the exact same items for the Server, Web Service Runtime and Service Project. Else make appropriate changes to select them as displayed below.<br />[[Image:Ws_tdAxis2WizardFirstPage.png]]<br />Click next |
− | # This page is the skeleton JAVA bean configuration page. if you have a custom preferences you can edit the configuration as needed, for the moment default will do.<br />[[Image: | + | # This page is the skeleton JAVA bean configuration page. if you have a custom preferences you can edit the configuration as needed, for the moment default will do.<br />[[Image:Ws_tdAxis2WizardConfigPage.png]]<br />Click next |
− | # This page is the start server page. Click on the start server. This will start the server runtime.<br />[[Image: | + | # This page is the start server page. Click on the start server. This will start the server runtime.<br />[[Image:Ws_tdAxis2WizardStartServerPage.png]]<br />Click next |
− | # This page is the web services publication page, accept the defaults.<br />[[Image: | + | # This page is the web services publication page, accept the defaults.<br />[[Image:Ws_tdAxis2WizardPublishPage.png]]<br />Click Finish. You will see the newly created skeleton page gets pop up in the Editor. If you need you can edit the skeleton to include your area service logic. But for the moment We will accept the defaults settings.<br /> |
# Here after the skeleton generation the user need to fill the nessesary parts of the service skeleton with the bussiness logic. In this example the CalculatedRectArea method TODO plus the exception must be replace with appropriate logic. For that we need some changes in the build system to auto reflect the change in the deployed service. One thing is we need to make sure that Build Automatically is enabled in the Project Menu. Then we need to change the output location of the project to the location where the service is deployed in the local web service runtime attached to the project. As in this example to the folder WebContent -> axi2-web -> WEB-INF -> services -> Axis2TestWs directory.<br />[[Image:sk_1.png]]<br /><br /> | # Here after the skeleton generation the user need to fill the nessesary parts of the service skeleton with the bussiness logic. In this example the CalculatedRectArea method TODO plus the exception must be replace with appropriate logic. For that we need some changes in the build system to auto reflect the change in the deployed service. One thing is we need to make sure that Build Automatically is enabled in the Project Menu. Then we need to change the output location of the project to the location where the service is deployed in the local web service runtime attached to the project. As in this example to the folder WebContent -> axi2-web -> WEB-INF -> services -> Axis2TestWs directory.<br />[[Image:sk_1.png]]<br /><br /> | ||
− | # So now we have done the nessesary thing to auto deploy our TD created web service. Now we go ahead and implement the skeleton. Replave the TODO plus the exception with the following logic foe calculating the Area. org.tempuri.areaservice.Area area = new org.tempuri.areaservice.Area(); area.setArea( parameters.getParameters().getHeight() * parameters.getParameters().getWidth(); return area;<br />[[Image: | + | # So now we have done the nessesary thing to auto deploy our TD created web service. Now we go ahead and implement the skeleton. Replave the TODO plus the exception with the following logic foe calculating the Area. org.tempuri.areaservice.Area area = new org.tempuri.areaservice.Area(); area.setArea( parameters.getParameters().getHeight() * parameters.getParameters().getWidth(); return area;<br />[[Image:Ws_tdAxis2WebServiceImplJavaFile.png]]<br />Tigger a auto build after saving. You will notice in the console that the service getting re deployed in the server.<br /> |
# Now we can run the Dynamic Web Project on the server to see our top down created web service running on axis2 server. For that Select the Axis2WSTest dynamic web project and select Run -> Run As -> Run on Server<br />[[Image:Ws_tdAxis2RunOnServer.png]]<br />Click Next. | # Now we can run the Dynamic Web Project on the server to see our top down created web service running on axis2 server. For that Select the Axis2WSTest dynamic web project and select Run -> Run As -> Run on Server<br />[[Image:Ws_tdAxis2RunOnServer.png]]<br />Click Next. | ||
# Make sure you have the Axis2WSTest dynamic web project on the Configured project.<br />[[Image:Ws_tdAxis2RunOnServer_Addproject.png]]<br />Click Next. | # Make sure you have the Axis2WSTest dynamic web project on the Configured project.<br />[[Image:Ws_tdAxis2RunOnServer_Addproject.png]]<br />Click Next. |
Revision as of 15:49, 7 May 2008
| ||||||||||||||||
|