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.
- In the Project Explorer, select the ConvertTemperature.wsdl document
in your EJB project.
- Click . Select Web Services in
order to display the various Web service wizards. Select the Web
Service wizard. Click Next.
- Select the following options on the first page of the wizard:
- Web service type: Top down EJB Web service
- Service definition: ensure the ConvertTemperature.wsdl file that you imported
is selected.
- Level of service generation slider: move the slider to Test service.
- Service configuration: ensure that WebSphere v6.1 Server and the IBM WebSphere
JAX-RPC runtime environment are selected. Click Service project and
enter TempEJB as your service project name. TempEJBEAR should
be selected as your service EAR project.
- Level of client generation slider: move the slider to Test client.
- Client configuration: ensure that WebSphere v6.1 Server and the IBM WebSphere
JAX-RPC runtime are selected. The wizard will create a client and client EAR
project. You can accept the default names or enter a different name.
- Monitor the Web service.
Once you have selected the correct options the wizard should look
similar to the following:
Click Next.
- On the Web Service Skeleton EJB Configuration page, select RouterWebProject as
your router project if it is not already selected.
- In the Web Service Test page, you can select a test facility to
test your Web service before a client or proxy is developed. Select Web Services
Explorer as the test facility for your Web service and click Launch.
This step may take several seconds for the WebSphere Application server to
start.
- The Web Services Explorer is displayed in a Web browser. Select fahrenheitToCelsius or celsiusToFahrenheit from the operations list. Enter a number in the value field and click Go.
A trivial implementation of each of these operations is provided, and a default
value of -3 is returned. If both operations complete successfully, close the
browser window and click Next in the Web services wizard.
- In the Web Service Proxy page, keep the Security Configuration
selection at No Security to remain WS-I compliant.
Click Next.
- In the Web Service Client Test page, ensure Test the
generated proxy and Run test on server are
both selected. In the Methods section. ensure that all methods are selected,
or click Select All to select all methods. If you want
to publish your Web service to a UDDI Registry, click Next to
configure the Web Service Publication options. However this step will not
be covered in this tutorial. Otherwise, click Finish.
- The sample application is launched in a Web browser. You can use
this application to test the Web service by selecting a method in the Methods
frame, entering an input value in the Inputs frame, and clicking Invoke to
view the result in the Result frame. Do not close the TestClient.jsp browser
window yet - it will be used to test the Web service traffic for WS-I compliance
later in this tutorial.