Exercise 1.3: Creating the Web service
Before you begin, you must complete Exercise 1.2: Creating a server and server configuration for JMS.
The WSDL document describes where the Web service is deployed
and what operations this service provides. To create the WSDL document, deployment
descriptor file, proxy, and sample, follow these steps:
- Click File > New > Other. Select Web Services in
order to display the various Web service wizards. Select the Web Service wizard.
Click Next to start the Web Service wizard.
- In the Web service type field, ensure EJB Web service is
displayed and that the following check boxes are selected:
- Start Web services in Web project
- Generate a proxy
- Create folders when necessary
Do not select Test the Web Service; the Web Services Explorer which is
used to test Web services does not support SOAP over JMS.
- On the Object selection page the JMSEAR should be prefilled, and the TestEJB bean should be listed in the EJB Bean table.
Select TestEJB and click Next.
- The Web Service Deployment Configurations page allows you to select from
supported run-time protocols and deployment servers. You will use the default
run-time environment, IBM WebSphere v6, and the server that you created
in the previous task, WebSphere v6 Server. Ensure that the EJB, and client projects
(where the Client type is Web) selected match those in the picture below. Since
the wizard creates the client project for you, you can manually enter the
name of the client project. Click Next.

- On the Web service EJB configuration page, the Router project that you
imported as part of the JMSEAR should be selected. Under Select Transports, select SOAP over JMS.
Most of the required information in this section should be prefilled. You
will have to manually enter the following values:
- Ensure that queue is selected as the JMS destination. This
sample will not work for topics.
- jms/ws_tutorial_queue as the Destination JNDI Name
- jms/ws_tutorial_qcf as the JMS Connection Factory
- TestEJB as the name of the port component to which the request will be dispatched. The name of the port component is the target service name, therefore, TestEJB
will be used as target service name.
- eis/ws_tutorial_JMSRouter as the ActivationSpec JNDI Name
The completed page should look similar to the following:

- In the Web Service Java Bean Identity page of the wizard you
can specify your Web service URI, scope, and the names of the generated files. You can also select the methods that will be included in your Web service, the encoding style, and configure security for your Web service. Click Next to
accept the default values.
Important: The Uniform Resource
Identifier (URI) for your Web service is automatically generated by the wizard from the artifact you selected to turn into a Web service. The default base URI http://tempuri.org/ is used to construct a URI without any unique association to an entity. The host name tempuri comes from the WSDL specification and stands for temporary URI. Use the default base URI when you do not want to make the URI globally unique. It is not recommended to use http://tempuri.org/ as the base for stable fixed entities.
- Because JMS is WS-I non-compliant, unless you have set your WS-I
compliance settings to Ignore, an error message displays warning you of the incompliance. If you click Details the reason for the warning message is shown. You can safely ignore this warning; click Ignore.
- In the Web Service Proxy page, ensure that Generate a proxy is selected. The client proxy provides a remote procedure call interface to your Web service. Do not enable security
for the generated proxy.
Click Next.
- Use the Web Service Client test page to select the following options:
- Select to generate a sample Web service sample JSP as your test facility.
- Select the folder where the JSP will be located, and ensure all methods
are included in the JSP.
- Select Run test on server to start the server for you automatically.
Click Finish.
- The proxy JSP is launched in a Web browser at the following URL:
http://localhost:9080/JMSClient/sample/TestEJB/TestClient.jsp You can use
this sample application to test the Web service by selecting a method, entering
a value for the method, and clicking Invoke. The result of the method
- an echo of the string you entered in the text field - will display in the
results pane.
Finish your tutorial by reviewing the materials in the Summary.