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.
Procedure
- 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.
The slider sets the defaults on the remaining wizard pages, but you
can override the default settings on each page as you proceed.
- Service configuration: Ensure that WebSphere Application Server Version 7
or later and the IBM® WebSphere JAX-WS 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 Application Server Version 7
or later and the IBM WebSphere JAX-WS 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.
Click Next.
- On the Web Service Configuration page, leave all the default
options selected, and click Next.
- On the Router project configuration page, select RouterWebProject as your http router project if it is
not already selected, and click Next.
- 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 Client Configuration page, keep the
default selections. 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. 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.