Chapter 12. J2EE Connector Architecture scenario 409
Figure 12-8 DFHCOMMAREA from CICS COBOL program
The martacct program file provides add, update, delete, and retrieve capability to
the database. To separate these functions, a flag called MART-FLAG will be sent
with every enterprise function call. Figure 12-9 shows the functions available in
the program.
Figure 12-9 Functions available in CICS-COBOL program
12.4.2 Create a JCA application to access the enterprise application
Rational Software Architect includes wizards that assist you in creating JCA
applications.
410 Patterns: Implementing Self-Service in an SOA Environment
The steps to create the application are as follows:
1. Create a data binding class that maps the COBOL structures to Java.
2. Create a J2C Java bean that will have the EIS connection information and the
Java methods that call the EIS functions. A J2C Java bean will use the data
binding bean class as the input and output to the available functions.
3. Optionally: Deploy the created bean as a JSP, EJB, or Web service. In this
scenario, we will deploy the J2C Java bean as a Web service.
Note that to test the application you need to have the COBOL application running
on the CICS server.
Step 1: Create the data binding class
Perform the following steps:
1. In the workbench, select File New Other J2C in the tool bar.
2. Expand J2C and select CICS/IMS Java Data Binding, as shown in
Figure 12-10 on page 411.
Preparation: Before working with JCA applications in Rational Software
Architect, be sure to do the following:
1. Ensure the J2C capability is enabled in your workspace:
a. Open the workspace and select Window Preferences.
b. Expand Workbench and click Capabilities. Make sure the box to the
left of the Enterprise Java folder is checked.
c. Click Apply and then OK.
2. Open the J2EE perspective.
This sample assumes that you have created the following:
򐂰 An enterprise application project called JCAModule. The J2EE properties
for the project specify J2EE version 1.4. The server properties specify
WebSphere Application Server V6.0 as the target server.
򐂰 A dynamic Web project in JCAModule called JCAWeb. The context root is
JCAWeb. The project properties specify Servlet version 2.4 and
WebSphere Application Server V6.0 as the target server.
Chapter 12. J2EE Connector Architecture scenario 411
Figure 12-10 Create the J2C data binding
Click Next.
3. The next screen gives you the following data binding options:
C MPO to Java
COBOL to Java
C to Java
COBOL MPO to Java
Select COBOL to Java from the drop-down.
Browse to the COBOL program file, martacct.ccp, and click Next.
4. In the next panel, select the platform the CICS server is running on and
provide the code page settings.
Click Query to display the data structures available in enterprise application
program and select the appropriate settings.
In our example, we used the settings shown in Figure 12-11 on page 412.
412 Patterns: Implementing Self-Service in an SOA Environment
Figure 12-11 Import settings
Click Next.
5. Figure 12-12 on page 413 allows you to specify the values to use in creating
and saving the new file.
Chapter 12. J2EE Connector Architecture scenario 413
Figure 12-12 Import settings ,Data Binding name: MartAccounts
Choose Default for the generation style.
In the Data Binding section, provide the Web project name, JCAWeb.
Enter the package name com.ibm.patterns.jcaService.
The class name defaults to the one chosen in the Importer panel
(Figure 12-11 on page 412). We chose DFHCOMMAREA. Rename it to
MartAccounts.
Click Finish.
You can see the new file in the Project Explorer view (Figure 12-13 on page 414).

Get Patterns: Implementing Self-Service in an SOA Environment 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.