114 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
Figure 5-11 Trader EJB Inbound Service
4. Click Finish, accepting the defaults for the entries for EJB port, SOAP binding
properties, and SOAP port.
Configuring the Traderbl EJB JNDI bindings
To configure the connection factory JNDI bindings that will be used by the server:
1. Navigate to the J2EE Hierarchy view. Expand the CICSJCAEJB module
under the EJB Modules folder. Navigate to Session Beans
TraderblService. Double-click TraderblService to open the EJB deployment
descriptor for editing.
Chapter 5. Using J2EE Connector Architecture 115
2. Select the References tab. Enter eis/TraderblService for the JNDI name in
the WebSphere Bindings section as shown in Figure 5-12.
Figure 5-12 EJB JNDI bindings
Creating and configuring the integrated test environment
In this step, you create the integrated test environment (ITE) for WebSphere
Business Integration Server Foundation 5.1.
1. Open the servers view, if it is not already opened. Right-click an empty area,
and choose New
Server and Server Configuration.
2. Expand the WebSphere Version 5.1 folder, select Integration Test
Environment, and name the server WBITEST. Click Finish.
Next, add the resource adapter and connection factory to the server
configuration to specify to which CICS system you are connecting.
1. Double-click WBITEST from the Servers tab to bring up the server
configuration.
2. Click the J2C tab.
3. In the Node Settings section for J2C Resource Adapters, click Add.
116 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
4. Choose cicseciConnector from the list as shown in Figure 5-13. Click OK.
Figure 5-13 Select imported CICS Resource Adapter
5. Configure the Java Authentication and Authorization Service (JAAS)
authentication alias to be used by container when creating the connection
factory.
a. Select the Security tab.
b. In the JAAS Authentication Entries section, click Add .
c. Enter an Alias as CISAuth. Enter the User ID and Password used to
access the CICS system.
d. Click OK.
6. Configure the J2C Connection factory for the resource adapter. Click the J2C
tab.
7. Select cicseciConnector from the resource adapters.
8. In the J2C Connection Factories section, click Add.
9. Enter the following:
a. Name: TraderblService
b. JNDI Name: eis/TraderblService. The same name given in the EJB
deployment descriptor’s ResourceRef tab.
c. From the drop-down list for the Container-managed authentication alias,
select CICSAuth.
10.Click OK.
Chapter 5. Using J2EE Connector Architecture 117
11.Set the server and connection information.
a. Scroll down to the Resource Properties section.
b. Enter the server name of your CICS system. In our example, this name
was SCSCERW.
c. Enter the ConnectionURL. In our example, this connection was
tcp://wtsc52.itso.ibm.com®.
12.Press Ctl+S to save the WBITEST Server configuration.
13.Start the server by right-clicking WBITEST from the server tab and selecting
Start.
5.4.3 Testing and running the scenario
You can test the retrieval of the company list using an EJB proxy and JUnit test
class.
Generating EJB proxy
Generate an EJB proxy which exposes the service through a Java class.
1. Right-click the TraderblEJBService.wsdl file. Choose Enterprise Services
Generate service proxy to launch the Generate Service Proxy wizard.
2. Choose WSIF and click Next.
3. Accept the defaults, including, class name TraderblProxy.java. Click Next.
4. Select client stub, then select the retrieveCompanyList() operation. Click
Finish.
This proxy class uses WSIF to invoke the EJB retrieveCompanyList operation.
Generating JUnit test case
Add the junit.jar to the project, then use the JUnit Test Case wizard to create the
test class.
1. Change to the Java perspective. Right-click the CICSJCAEJB project, then
select Properties.
2. Select Java Build Path, then the Libraries tab. Click Add External Jars.
3. Navigate to the ..eclipse\plugins\org.junit_3.8.1 folder and choose junit.jar.
Click Open.
4. Click OK to add the JAR to the project’s Java Build Path.
5. Select TraderblProxy in the CICSJCAEJB project.
6. Right-click TraderblProxy then choose New
Other.

Get Managing Information Access to an Enterprise Information System Using J2EE and Services Oriented Architecture now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.