In this lesson you will learn how to create the bottom up EJB Web
service.
The WSDL document describes where the Web service is deployed and
what operations this service provides. You can create the WSDL document, deployment
descriptor file, proxy, and sample, by following these steps:
- Click . 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, select Bottom
up EJB Web service.
- Select your service implementation by clicking Browse.
A window displays which has all the available enterprise beans listed. Select
the TestEJB bean.
- In order to create a service and a client and to start both of
these on the server, move the slider for the service to the "Start" position,
and the slider for the client to the "Test" position. This will create all
the appropriate service and client code, projects, and router modules, associate
them with the correct EAR, create the deployment code, install the EAR on
the target server, and start the service. It will not test the service because
the Web Services Explorer does not support Web services over JMS.
- Ensure that the following server-side options are selected:
- Server: WebSphere v6.1 Server
- Runtime: IBM WebSphere JAX-RPC runtime environment
- Service project: JMSService
- Service EAR project: JMSEAR
Ensure that the following client-side options are selected:- Server: WebSphere v6.1 Server
- Runtime: IBM WebSphere JAX-RPC runtime environment
- Client project: JMSServiceEJBClient
- Client EAR project: JMSServiceEJBClientEAR
The projects which do not already exist will be created for you by the
wizard. When you have selected all your options it should look similar to
the following:
- On the Web service EJB configuration page, select JMS as
your transport method and clear the HTTP check box if it is selected. The
JMSServiceRouter router project that you imported as part of the JMSEAR should
be selected. Click Next. 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.
- On the EJB Web service binding configuration page you will have
to manually enter the following values to match the queues and connection
factories created in the previous lesson:
- Ensure that queue is selected as the JMS destination. This tutorial will
not work for topics.
- jms/ws_tutorial_queue as the Destination JNDI Name
- jms/ws_tutorial_qcf as the JMS Connection Factory
- 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.
- The Web Service Proxy page lists the location where the proxy code
will be generated. 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.