290 Migrating from WebSphere Application Server Community Edition to WebSphere Application Server
4. Modify ejb-jar.xml to link the EJB to the Web service as highlighted in
Example 7-4.
Example 7-4 The ejb-jar.xml file
<session id="Session_LodgingPOEndpoint">
<description><![CDATA[An EJB named LodgingPOEndpoint]]></description>
<display-name>LodgingPOEndpointBean</display-name>
<ejb-name>LodgingPOEndpoint</ejb-name>
<service-endpoint>
com.sun.j2ee.blueprints.lodgingsupplier.powebservice.LodgingPOEndpo
int
</service-endpoint>
<ejb-class>
com.sun.j2ee.blueprints.lodgingsupplier.powebservice.LodgingPOEndpo
intSession </ejb-class>
After completing these steps, the LodgingPOEndpointBean Stateless Session
Bean is exposed as a Web service.
Generating a Web Service Client
To generate a client for the WebServiceBroker Web service, you need to obtain
its WSDL file. The WSDL file is in the OPC module of the Adventure Builder
application. You can import the WSDL file into the META-INF/wsdl directory of
the LodgingSupplier-EJB project in Eclipse.
You use the wscompile tool provided in the Sun JWSDP v2.0 to create the client
files required by WebSphere Application Server Community Edition V1.1.0.1.
The wscompile tool takes an XML configuration as input in which you specify the
path to the WSDL for the Web service for which you need to generate a client.
Example 7-5 shows this file.
Example 7-5 The webservicebroker-client-config.xml file
<?xml version="1.0" encoding="UTF-8"?>
<configuration
xmlns="http://java.sun.com/xml/ns/jax-rpc/ri/config">
<wsdl name="WebServiceBrokerClient"
location="file:wsdl/WebServiceBroker.wsdl"
packageName="com.sun.j2ee.blueprints.lodgingsupplier.pomessagebean">
<typeMappingRegistry />
</wsdl>
</configuration>