JAXWS/SmokeTestScenarios/
< JAXWS
Revision as of 18:20, 14 October 2009 by Shane clarke.hotmail.com (Talk | contribs) (New page: <h2>Prereqs</h2> * Download and Install the Apache CXF Runtime (version 2.2.x) from the [http://cxf.apache.org/download.html Apache CXF] downloads page. * Configure the Apache CXF Runtime ...)
Contents
Prereqs
- Download and Install the Apache CXF Runtime (version 2.2.x) from the Apache CXF downloads page.
- Configure the Apache CXF Runtime in the Window > Preferences > Web Services > CXF 2.x Web Services preference page.
- Install the latest version of Apache Tomcat.
Scenario 1: Create a Bottom Up Web Service
- Create a Dynamic Web Project.
- Import the wtp/Converter.java class into the source folder of Dynamic Web Project.
- Right-click on the Converter.java class and select Web Services > Create Web Service to open the Web Service wizard.
- Move the slider to the Test service stage.
- In the Service Configuration: section:
- Verify that Apache Tomcat is the selected Server:. (Or select an alternate server to deploy the web service to)
- Select the Web service runtime: link and select 'Apache CXF 2.x' in the resulting dialog.
- Verify that the selected Service project: is the Dynamic Web Project that contains the Converter.java class.
- Click Next >.
- Select the Use a Service Endpoint Interface: checkbox.
- Select the Create an SEI radio button.
- Enter a name for the SEI in the text field.
- Click the Select All button.
- Click Finish. After creating the service, deploying to and starting Tomcat, the wizard will launch the Web Services Explorer.
- In the Web Services Explorer
- Under Operations in the right hand pane, click on farenheitToCelsius.
- In the float entry field enter a 72.0 and click Go.
- The Status pane should display return (float): 22.222221
Scenario 2: Create a Top Down Web Service
- Create a Dynamic Web Project.
- Import the AreaService.wsdl into the Dynamic Web Project's WebContent folder.
- Right-click on the AreaService.wsdl file and select Web Services > Generate Java bean skeleton to open the Web Service wizard.
- Move the slider to the Test service stage.
- In the Service Configuration: section:
- Verify that Apache Tomcat is the selected Server:. (Or select an alternate server to deploy the web service to)
- Select the Web service runtime: link and select 'Apache CXF 2.x' in the resulting dialog.
- Verify that the selected Service project: is the Dynamic Web Project that contains the AreaService.wsdl file.
- Click Finish.
- Open the generated implementation class org.tempuri.areaservice.AreaServiceImpl.
- Replace the generated method body of the calculateRectArea() method to return parameters.getHeight() * parameters.getWidth() and save the class.
- Restart the Apache Tomcat server.
- In the Web Services Explorer
- Under Operations in the right hand pane, click on CalculateRectArea.
- In the width float entry field enter a 12.0 and in the height float entry field enter 2.0 click Go.
- The Status pane should display area (float): 24.0