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:

  1. 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.
  2. In the Web service type field, ensure EJB Web service is displayed and that the following check boxes are selected:
    Screen capture of the first page of Web Services wizard
    Do not select Test the Web Service; the Web Services Explorer which is used to test Web services does not support SOAP over JMS.
  3. 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.
  4. 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.
    screen capture of the page on the wizard where JMS settings are added
  5. 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:

    The completed page should look similar to the following:
    Screen capture of  Web Service Deployment Configuration page of Web Services wizard

  6. 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.

  7. 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.
  8. 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.
  9. Use the Web Service Client test page to select the following options: Click Finish.
  10. 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.

Feedback
(C) Copyright IBM Corporation 2000, 2004. All Rights Reserved.