Monday, November 26, 2007

J2C CICS ECI - Generate Simple JSP

Do the same steps as generate a web service, instead, select Simple JSP at the J2EE Resource Type.

Enter /minzyWeb as the Web project, ou as the JSP folder.

Show Advanced, if the Resource Reference is missing, enter eisOrderUpdateRef.

Click on Finish.

Notice 4 jsp files were created under WebContent\ou.

J2C CICS ECI - Generate Web Service

Start Web Page, Web Service, or EJB from J2C Java Bean wizard.

Enter \minzyConnect\src\tliu\minzy\eis\ou\OrderUpdateJ2CImpl.java as the J2C bean implementation. Click on "Next >".

Select "Web Service" and click on "Next >".

Browse and select /minzyWeb, show advanced and enter eisOrderUpdateRef as the resource reference, keep JNDI lookup name as eis/OrderUpdate as proposed.

Click on Finish.

Notice minzyWeb was changed to have a reference to minzyConnect, 10 classes generated under tliu.minzy.eis.ou, OrderUpdateJ2CImpl.wsdl generated under WEB-INF/wsdl and webservices.xml, etc under WEB-INF.

Note, do not remove the "gen" folder. It is the generated folder for the 10 new classes.

J2C CICS ECI - Generate J2C Bean Classes

Select DIC44010.cpy and start J2C Java Bean wizard.

Select ECIResourceAdapter (IBM 6.0.2.1) under J2C 1.5. (CTG 6.1 needs this match up)

Give eis/OrderUpdate as JNDI name.

Click on "New...", select WAS v6.1 as server.

Enter tcp://10.104.252.233 as Connection URL. (For remote, tcp://, for WAS and CTG on same server, local:), AMGCOHA3 as server, 32006 as the port number, user and password etc.. (configurations here shall be obtained from CTG admin)

After that, enter minzyConnect as project, tliu.minzy.eis.ou as package, OrderUpdateJ2C as interface, the implementation class will automatically be given as OrderUpdateJ2CImpl.

At next step, click on Add... to add a method.

Give updateOrder as the method name.

Click on Browse... and select OrderUpdateBind as input type and check on Use the input type for output.

If execute time out is a required argument, enable the Show Advanced and expand Interaction Spec to select executeTimeout - int.

Click on Finish and enter DIC44010 as the Function name.

Click on Finish and generate the J2C Java bean.

Notice the OrderUpdateJ2C and OrderUpdateJ2CImpl were created under tliu.minzy.eis.ou, cicseci6021 i was created and minzyConnect was updated to have cicseci6021 in its build path.

Wednesday, November 21, 2007

J2C CICS ECI - Generate J2C Data Binding Classes

Select the DIC44010.cpy file and summon the J2C CICS/IMS Java Data Binding wizard.

Choose mapping COBOL to Java.

Select z/OS for Platform, IBM-037 for Code page. Click on Query.

Select the DFHCOMMAREA which is the CICS common area.

Select "Shorten names" as Generation Style, minzyConnect as project, tliu.minzy.eis.ou as package, OrderUpdateBind as class.

Class OrderUpdateBind, OrderUpdateBind_DFH_PAL_ID_DATA_DFH_EPC_DATA and OrderUpdateBind_DFH_PAL_ID_DATA will be created under tliu.minzy.eis.ou.

J2C CICS ECI - Obtain COBOL Copybook

RSA J2C wizard in version 7 accepts only the copybook of common area. It used to accept the whole COBOL program in WSAD version 5.1. I obtained the whole program and I found out I needed to trim it to the copybook only and rename it from DIC44010.ccp to DIC44010.cpy. The wizard actually tells the difference between ccp and cpy.

The copybook looks like this,
01 DFHCOMMAREA.
02 DFH-INPUT-FIELDS.
05 DFH-MRG-NBR PIC 9(07) VALUE ZEROS.
05 DFH-DC-NBR-FILLING PIC X(02) VALUE SPACES.
05 DFH-SESSION-CNT PIC 9(02) VALUE ZEROS.
05 DFH-PAL-ID-DATA OCCURS 5 TIMES.
10 DFH-PAL-ID-NBR PIC 9(03) VALUE ZEROS.
10 DFH-PAL-EPC-NBR PIC 9(09) VALUE ZEROS.
10 DFH-EPC-DATA OCCURS 300 TIMES.
15 DFH-EPC-NBR PIC 9(12) VALUE ZEROS.
02 DFH-STATUS-FIELDS.
05 DFH-RETURN-CODE PIC 99 VALUE ZEROS.
05 DFH-RETURN-TEXT PIC X(80) VALUE SPACES.
05 DFH-PROGRAM-NAME PIC X(08) VALUE SPACES.
05 DFH-ERROR-STATUS PIC X(04) VALUE SPACES.
05 DFH-ERROR-RECORD PIC X(16) VALUE SPACES.
05 DFH-ERROR-SET PIC X(16) VALUE SPACES.
05 DFH-ERROR-AREA PIC X(16) VALUE SPACES.
05 DFH-DML-SEQUENCE PIC 9(08) VALUE ZEROS.
Do not edit the file.

I created a eis folder under minzyConnect. I put DIC44010.cpy under the newly created eis folder.

J2C CICS ECI - Review the Environment

In this trial, I will create a J2C service to call a CICS COBOL program. I use
  • IBM Rational Software Architect (RSA) v 7.0.0.3
  • IBM WebSphere Application Server (WAS) v 6.1, embedded in RSA 7
  • IBM CICS Transaction Gateway (CTG) v 6.1
CTG connection URL is tcp://10.104.252.233, port 32006, server name AMGCOH3, user name ctgwebu, and password ***.

Note, if WAS and CTG sit at the same server, CTG connection URL shall be local:.

Project minzyConnect is created to hold the data binding and J2C beans.

Project minzy is created as EAR holder, and its module project minzyWeb, minzyEnt (for EJB), and minzyClient are also created.

Tuesday, November 20, 2007

CICS Transaction Gateway

Connection URL set to "local" if the servlet sits at the same server. Set to "tcp:" if the servlet needs to connect a remore CICS Transaction Gateway, e.g. tcp://9.100.101.102:2006.

Friday, November 16, 2007

Informatica Upgrade to 8.1.1 - Client

Informatica is a Web Service Hub. When the server upgrades to 8.1.1, from the client side, do the followings,
  1. Open the Hub's home page, e.g. http://host:7333/wsh/
  2. Click on the "Batch Web Services"
  3. Click on the WSDL icon under Metadata WSDL
  4. Right click on the pop-up page and select "View Source"
  5. Save the content as MetaData.wsdl
  6. Do the same for DataIntegration WSDL, save as DataIntegration.wsdl
  7. Import these two files to a RSA project
  8. Add axis-1.4.jar to the project
  9. Create a Java Application Run,
  10. Set main class as org.apache.axis.wsdl.WSDL2Java
  11. Check "Include libraries when searching for a main class" on
  12. Select Arguments tab
  13. Enter "--NStoPkg http://www.informatica.com/wsh=com.informatica.www -W informatica-8.1.1/MetaData.wsdl" as Program arguments, where the informatica-8.1.1 is the folder of MetaData.wsdl file
  14. Run this Java Application
  15. Informatica client code for MetaData service will be generated
  16. Do the same for DataIntegration service
  17. There are some changes from version 7, especially of the connection, workflow and folder
  18. Modify the client application accordingly

CICS ECI Resource Adapter

The CICS resource adapter makes use of interfaces within J2EE Connector Architecture to facilitate the communication between J2EE applications and CICS information systems. The JCA defines a programming interface called the Common Client Inteface (CCI). This interface can be used, with minor changes, to communicate with any EIS. This CICS Transaction Gateway provides resource adapters that implement the CCI for interfactions with CICS.
  • ECIResourceAdapter (IBM : 5.1): This version of the CICS ECI resource adapter is based on Version 1.0 of the J2EE Connector Architecture (JCA 1.0). Because CICS ECI resource adapter for Java verion 5.1 is a JCA 1.0 resource adapter, it will only run in a JCA 1.0 application server or WAS version 5.0.2 (or above). Select CICS 5.1 resource adapter if targeting a WAS v 5.0 server.
  • ECIResourceAdapter (IBM : 6.0.2): This version of the CICS ECI resource adapter is based on version 1.5 of the JCA (JCA 1.5). It runs on WAS 6.0.
  • ECIResourceAdapter (IBM : 7.0.0): This version based on JCA 1.5. It runs on WAS 6.1.

If you select Configure Resource Adapter Deployment on the Deployment Information page of the J2C wizard, you can use the Resource Adapter Deployment page to configure RAR.

The resource adapter can be deployed as a standalone resource adapter or as part of an EAR file. Typical environments use the standalone method, giving all modules on the application server visibility to the adapter.

Note: Multiple resource adapters should not be installed as standalone on the same runtime server, especially if they are for the same EIS type (for example, CICS ECI 5.1 and CICS ECI 6.2). This is because all standalone resource adapters share the same class loader.

My note: It's probably easier for application maintanence to deploy the adapter per EAR file.