Chapter 8. Router solutions using Web Services Gateway 173
Example 8-3 Generating server deployment descriptors and classes using WSDL2Java
C:WebSphereAppServerinWSDL2Java -verbose -role server -container ejb
-output C:WorkspaceWSWholesale1EJBejbModule
c:WorkspaceWSWholesale1EJBejbModuleMETA-INFwsdlWholesale1Direct.wsdl
5. Right-click the EJB project and select Refresh. You should see the generated
files shown in Figure 8-15.
The webservices.xml deployment descriptor defines the set of Web services
that are being deployed in the Web service-enabled J2EE container.
Figure 8-15 Generated files
6. Navigate to WSWholesale1EJB ejbModule META-INF and edit
webservices.xml. Set the ejb-link element to Inventory, as shown in
Example 8-4.
The ejb-link element corresponds to the ejb-name element of the required
EJB, as defined in ejb-jar.xml.
Example 8-4 Updating webservices.xml
...
<service-impl-bean id="ServiceImplBean_1063202220893">
<ejb-link>Inventory</ejb-link>
</service-impl-bean>
...
Note: The deployment descriptors and class files will not be regenerated
when the tool is re-run, unless the existing files have been removed first.
174 Broker Interactions for Intra- and Inter-enterprise
7. Run the endptEnabler command line tool to add an HTTP router module to
the EAR file.
In WebSphere Studio V5.1, right-click the EAR project, and select Web
Services
Endpoint Enabler from the pop-up menu.
Tip: This step is only required if the Web service is implemented in an EJB
module.
Note: Alternatively, you could also use the command shown in
Example 8-5. To do this you first need to export the WSWholesale1EAR
project to an EAR file:
a. Right click the WSWholesale1EAR project and select Export....
b. Select EAR file and click Next.
c. Select the destination you want the EAR file to be exported to, for
example:
C:WebSphereAppServerinstallableAppsWSWholesale1EAR.ear
d. Click Finish.
e. Run the endptEnabler command:
C:WebSphereAppServerinendptEnabler
WSWS2004I: IBM WebSphere Application Server Release 5
WSWS2005I: Web Services Enterprise Archive Endpoint Enabler Tool.
WSWS2007I: (C) COPYRIGHT International Business Machines Corp. 1997,
2003.
WSWS2006I: Please enter the name of your EAR file: WSWholesale1EAR.ear
WSWS2003I: Backing up EAR file to: WSWholesale1EAR.ear~
WSWS2016I: Loading EAR file: WSWholesale1EAR.ear
WSWS2017I: Found EJB Module: WSWholesale1EJB.jar
WSWS2029I: Enter http router name for EJB Module WSWholesale1EJB
[WSWholesale1EJB_HTTPRouter.war]: WSWholesale1EJB_HTTPRouter.war
WSWS2030I: Enter http context root for EJB Module WSWholesale1EJB
[/WSWholesale1EJB]: Wholesale1
WSWS2024I: Adding http router for EJB Module WSWholesale1EJB.jar.
WSWS2036I: Saving EAR file WSWholesale1EAR.ear...
WSWS2037I: Finished saving the EAR file.
WSWS2018I: Finished processing EAR file WSWholesale1EAR.ear.
Chapter 8. Router solutions using Web Services Gateway 175
The endptEnabler tool makes the following changes to the EAR file:
? Adds a Web module to the EAR file that contains the HTTP router for the EJB
module and sets the context root for the Web module in application.xml.
? Adds servlet and servlet-mapping elements to the Web module deployment
descriptor. These elements map the Web service endpoint URL to the Web
services router servlet, and are added for each Web service in the module.
Note: If you used the WebSphere Studio Endpoint Enable wizard, the
context root for the Web module is automatically chosen for you. Open the
EAR deployment descriptor and if necessary, alter the context root to
match the context you used earlier in the -location attribute of the
Jave2WSDL command (see Example 8-2 on page 172. In this example,
the context is /Wholesale1.
Note: The URL mappings must match the values you used in the -location
attribute of the Jave2WSDL command (see Example 8-2 on page 172) —
in this example, “services/InventoryWholesale1”.
176 Broker Interactions for Intra- and Inter-enterprise
? Adds a routerModule element to ibm-webservices-bnd.xmi in the EJB
module.
The EAR file is now ready to deploy in the IBM WebSphere Application Server
V5.0.2 runtime.
8. Generate the EJB deployment code:
a. Select, then right-click the WSWholesale1EAR project, and select
Generate
Deploy and RMIC Code from the pop-up menu.
b. In the Generate Deploy and RMIC Code window, click Select all to select
all the EJBs, then click Finish.
8.6.3 Register the services in the UDDI Registry
In this scenario, the private UDDI Registry shipped with the WebSphere
Application Server Network Deployment and Enterprise packages was used. To
make Web services available through the private UDDI registry, follow these
steps:
Testing the Web service using WebSphere Studio:
A simple method of testing the Web service you have created is to use the
Web Services Explorer. To use the Web Services Explorer, right-click the
WSDL file for the Web service and select Web Services -> Test with Web
Services Explorer. The Explorer will start in a Web browser window. From
there you can select the Web service method you want to test, or add / change
the Web service endpoints.
Chapter 8. Router solutions using Web Services Gateway 177
1. Install the UDDI Registry. The UDDI Registry used in this scenario was
installed from and deployed on WebSphere Application Server Enterprise
V5.0.2 with the 5021 fix applied.
Once the application server and the Web services features have been
installed and brought up to the correct fixpack level, you will need to complete
the installation of the UDDI Registry using the instructions in the InfoCenter.
The UDDI Registry is an enterprise application that runs on an application
server, so this process includes creating a database for the UDDI Registry to
store data in and installing the UDDI Registry application. Scripts are
provided to do this.
2. Register the business.
3. Add a technical model of the Web service.
4. Add the service to the business, associating the correct technical model to the
service.
Register the business
The first step in setting up the UDDI Registry is to publish the business in the
registry.
1. Open the UDDI registry console:
(http://uddi.itso.ral.ibm.com:9080/uddigui/)
2. Select the Publish tab and click Add a business under the Advanced Publish
menu.
3. Enter the business name, select a language, and click the Add button to the
right of the Language field. This allows you to add multiple names for the
same business. It doesn’t actually publish the business yet. That doesn’t
happen until you click the Publish Business button, once you have
completed the rest of the fields.
4. Add a description if you like and click the Add button to the right.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.118.2.225