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 ..eclipsepluginsorg.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.
118 Managing Information Access to an EIS Using J2EE and Services Oriented Architecture
7. Expand Java, then select JUnit and choose TestCase.
8. Enter TraderblProxyTest for the test case. The test class should be
com.itso.cicsjca.TraderblProxy.
9. Click the check boxes for main() method, setUp(), and tearDown(). Click
Next.
10.Select the retrieveCompanyList() method on the Test Methods panel.
11.Click Finish to generate the test case.
To run the test case.
1. In the test method, add the code shown in Example 5-2.
Example 5-2 Test retrieveCompanyList proxy
TraderblCommarea commarea = new TraderblCommarea();
commarea.setRequest_type(“Get_Company “);//15 chars for REQUEST_TYPE
TraderblProxy proxy = new TraderblProxy();
commarea = proxy.retrieveCompanyList(commarea);
for(int i = 0; i < commarea.getCompany__name__tab().length;i++){
System.out.println(commarea.getCompany_name_tab(i));
}
assertTrue((commarea.getCompany_name_tab.length > 0));
2. Run the test case by right-clicking the class and selecting Run Run As
JUnit Test. Select the test class to run. Then click Run.
The program should return the list of companies in the system and print them out
to the console.
5.4.4 Creating the system process
At this stage, you have the CICS connector ready to use and the Get Company
List service exposed through both a Java proxy and an EJB binding service.
To incorporate this service into the business process, you create a trader EIS
business process that exposes all the trader features, including the
TraderblEJBService, as a partner to the system process. You can then expose
the Get Company List process through service invocations on the EIS business
process. The TraderblEJBService is a partner link in the overall Trader EIS
service.
The system process is explained in 2.2.6, “Logical architecture” on page 47. You
can have local and remote invocations based on context information. Depending
on the EIS service implementations, you can have a service or feature based
interactions.
..................Content has been hidden....................

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