EGL Integration with Web Services

© 2009 IBM Corporation

IBM Software Group

EGL Integration with COBOL and Web Services

Mark Evans (evansm@us.ibm.com)

EGL Development

®

IBM Software Group | Rational software

 © Copyright IBM Corporation 2009. All rights reserved.

 The information contained in these materials is provided for informational purposes only, and is provided AS IS without warranty of any kind, express or implied. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, these materials. Nothing contained in these materials is intended to, nor shall have the effect of, creating any warranties or representations from IBM or its suppliers or licensors, or altering the terms and conditions of the applicable license agreement governing the use of IBM software. References in these materials to IBM products, programs, or services do not imply that they will be available in all countries in which IBM operates.

 This information is based on current IBM product plans and strategy, which are subject to change by IBM without notice. Product release dates and/or capabilities referenced in these materials may change at any time at IBM’s sole discretion based on market opportunities or other factors, and are not intended to be a commitment to future product or feature availability in any way.

 IBM, the IBM logo, the on-demand business logo, Rational, the Rational logo, and other

IBM Rational products and services are trademarks or registered trademarks of the

International Business Machines Corporation, in the United States, other countries or both. Other company, product, or service names may be trademarks or service marks of others.

2

IBM Software Group | Rational software

Agenda

 Brief Introduction to Web Services

 RBD/EGL – A tool for Building Web Services

 Options for EGL Integration with COBOL Web Services

3

IBM Software Group | Rational software

Enterprise Modernization – Why Web Services ?

 Web services provide standardized access to assets for different software applications residing on disparate platforms

 Web service definitions provide abstract interfaces which allow for loose coupling between business components – implementation can vary without affecting consumers

 You can reuse applications exposed as Web services in a variety of service-oriented architecture frameworks, such as a process choreographer or an enterprise service bus .

4

IBM Software Group | Rational software

Enterprise Modernization and Web Services

 Basic Problem Statement:

 An Existing COBOL program on CICS contains the business/data logic for a business transaction

 A requestor/client outside CICS needs to obtain this information

 Solution

 Create Web Service to “front end” the called program

 Provides standard interface

Many tools work with and can access web services

Requester

Needs info

From CICS

Web Service

CICS TS 3.x or Later

Callable

COBOL

Program

DB2

Or

Files

5

IBM Software Group | Rational software

Enterprise Modernization and Web Services – Getting Started

 What’s Required?

1.

2.

3.

Standard Definition of the Services interface

SOAP format to contain the messages going back and forth

WSDL (Web Services Definition Language) to define the message content

A Web service (SOAP message) processor such as one of the following:

WebSphere Application Server

CICS

Tomcat

Other application servers

Tools to help build the necessary interfaces and work with the runtimes

CICS TS 3.x or later

Requester

Needs info

From CICS

SOAP Message/WSDL

Web Service

CICS

Web

Service

Runtime

WebSphere

Web Service

Support

Callable

COBOL

Program

DB2

Or

Files

6

IBM Software Group | Rational software

Agenda

 Brief Introduction to Web Services

 RBD/EGL – A tool for Building Web Services

 Options for EGL Integration with COBOL Web Services

7

IBM Software Group | Rational software

EGL Services Support – High Level View

At development time…

 focus on the business logic

 implement SOA design elements: Services & Interfaces

 leverage existing COBOL or RPG developers for new SOA development

 ignore deployment targets/technology while coding/testing

 Use Deployment Descriptor file to describe Deployment considerations

Use existing non-EGL Web Service

Create EGL Interface and EGL Records automatically based on existing WSDL

EGL

RUI/JSF/TUI

EGL

Service

EGL

Records

W

S

D

L

Build & expose EGL Web Service

Non-EGL

User of

EGL Service

EGL

Records

EGL

Interface

W

S

D

L

Existing

Service

EGL applications invoke operations in EGL Interface and send Records as parameters

Deploy EGL Services…

 in Java to Java to WAS, Tomcat, Win, Linux, HP-UX,

Solaris, iSeries

 in COBOL to CICS, System i

8

IBM Software Group | Rational software

Service Part – Built into the language

 A service is similar to a library, with the major exception that a service may be located remotely from its client.

The client

– which can be a program, JSF handler, library, or other service - uses (invokes) the functions defined in the service.

 Services have one or more public functions that contain business logic. Once you have written the business logic, you can deploy the service as one of the following:

 an EGL Java™ service

 a Web service

 an EGL COBOL service

 a CICS® Web Service

 In general, you create a Service part when you want to make your business logic available to other programs, either locally or remotely, in an encapsulated way.

Example of an EGL Service

9

IBM Software Group | Rational software

EGL Interfaces -

Concepts built into the language

Interface part

 Provides abstract definition of Service

 Can be created directly from WSDL for use by Web Service clients

 Access external services as EGL services

Interface IStockQuoteService

Function getQuote(symbol String) returns ( money ); end

Service StockQuoteService implements IStockQuoteService

Function getQuote(symbol String) returns ( money )

… end end

SOA

10

IBM Software Group | Rational software

EGL Services – EGL Deployment Descriptor Files

 EGL Deployment

Descriptor files are used to describe how EGL service applications are bound to the clients that call them, and vice versa

 Generates wrapper program for each service

 Service Client Bindings

 How to invoke the service

 Services Deployment

 How the service is invoked

 Sharable Protocols

 Common information for clients and services

11

IBM Software Group | Rational software

Agenda

 Brief Introduction to Web Services

 RBD/EGL – A tool for Building Web Services

 Options for EGL Integration with COBOL Web Services

12

IBM Software Group | Rational software

RBD/EGL SOA Integration with Enterprise Programs – Options

Web Service Based

Option 1

Web Service Based

Option 2

EGL and non-EGL client

Web Service

Requester SOAP Message

WSDL

CICS TS 3.x or later

Channel

RDz

Generated

Handlers

Cobol Call

Callable

COBOL/EGL

Program

CICS

Web

Service

Runtime

Channel

EGL

COBOL

Web Service

Cobol Call

Wrapper

EGL

COBOL

Service

Service Invocation

Call Interface Based

Option 3

WebSphere

EGL

Client

CICSECI or CICS J2C

Call Statement

13

IBM Software Group | Rational software

RBD/EGL SOA Integration – Option 1

EGL Integration with RDz Generated WSDL/Handlers

Web Service Based

Option 1

CICS

Web

Service

Runtime

Channel

CICS TS 3.x or later

RDz

Generated

Handlers

Cobol Call

Callable

COBOL/EGL

Program

SOAP Message

Web Service

Requester

WSDL

EGL and non-EGL client

Use Rational Developer for zSeries tools to:

 Create WSDL and/or WSBIND needed by CICS Web Services Runtime

 Create COBOL “wrappers” to front end the COBOL program

 More on this later

Use EGL to:

 Create an EGL interface from the RDz generated WSDL

 Create a client binding (how to invoke the service) in the EGL deployment Descriptor

 Create a EGL Client (e.g. Service) to invoke this interface

14

IBM Software Group | Rational software

Create web services for zOS runtimes – RDz* Tooling

 Build, Deploy, and Test Web services from existing applications

 Create source code skeletons from web service definitions

 Map web service definitions to existing application modules

 Supports traditional languages

 COBOL

 PL/I

 Supports zOS specific runtimes

 CICS

 IMS

 Batch

*RDz = Rational Developer for system z

15

IBM Software Group | Rational software

Consuming EGL Web Services – Create Interface and Client bindings

Copy the WSDL from RDz into the EGL project

Select the WSDL file and choose:

1.

“ Create EGL Client Interface ”

2.

Choose which web service you want to interface with

( Next )

3.

Choose (filled in for you based on WSDL)

 Location of source

 Which functions to interface with

4.

Click “ Next

” to specify client bindings

16

IBM Software Group | Rational software

Consuming non-EGL Web Services – Resulting Definitions

Need to fill in URI with URL used to invoke the web service http://<hostname>:<soaplistenerport>/<relativepathofservice>

17

IBM Software Group | Rational software

EGL CICS Web Service Client

CICS TS 3.1

EGL COBOL

Program or

Service

(including

3270 pgms)

Cobol Call

COBOL

Web Service

Proxy

Channel

CICS

Web

Service

Runtime

SOAP Message

HFS

WSDL

WSBIND

Service

Provider

 Generated from the EGL deployment Descriptor (web service client bindings)

18

IBM Software Group | Rational software

RBD/EGL SOA Integration – Option 2

Using EGL Web Services to create new logic or wrapper existing programs

Web Service Based

Option 2

CICS TS 3.x or later

Callable

COBOL/EGL

Program

Web Service

Requester

SOAP Message

EGL and non-EGL client

WSDL

CICS

Web

Service

Runtime

Cobol Call

Channel

EGL

COBOL

Web Service

Wrapper

Cobol Call

EGL

COBOL

Service

 Use RBD/EGL to:

 Create a service part (see previous slides)

Service part calls native COBOL program

 Add EGL Service Binding information to the EGL Deployment Descriptor

 Generate EGL service and Deployment Descriptor which creates

 WSDL and WSBIND needed by CICS Web Service Runtime

 COBOL modules to implement the EGL COBOL web service

19

IBM Software Group | Rational software

EGL CICS Web Services – Generation Process

Deployment

Descriptor file

(.egldd file)

HFS

WSBIND

WSDL

Build Descriptor file

(.eglbld file)

EGL Build

Server

CICS

Generation

Services Source

(.egl files) z/OS

PDS w/Load

Modules

Workstation z/OS

 Deployment Descriptor File  WSBIND, WSDL, & Wrapper COBOL programs

 Services  COBOL program

20

IBM Software Group | Rational software

EGL CICS Web Services – Deploying Service on CICS

 For resulting load modules :

 In CICS DFHRPL;

Add PDS with load modules for service and service wrapper

Add EGL COBOL Runtime library

 In CICS CSD

Add CICS Program entries (unless dynamically created)

Add any required DB2 related entries if program accesses DB2

 Install CICS groups/entries as necessary

 Perform CICS NEWCOPY if replacing existing load modules

 For Web Services Infrastructure :

 Add CICS Pipeline Entry to specify target HFS directories that generation writes to

( one time if you want to always generate to same HFS directory)

 Perform a CEMT P PIPELINE SCAN to:

Enable the Pipeline

Create WebService entry based on information in generated WSBIND file

Create URIMAP entry based on information in generated WSBIND file

NOTE: CICS Userid must have permission to write to HFS directories specified in Pipeline definition

 If using Transaction other than CPIH in Web Service Entry

Recommended if using EGL generated Web Service

Still must be associated with same program example as CPIH

Can be done by CEDA COPY command:

CEDA COPY TRANSACTION(CPIH) GROUP(DFHPIPE) AS(<newname>) TO(<group>)

 Install CICS group/entries as necessary

21

IBM Software Group | Rational software

RBD/EGL SOA Integration – Option 3

EGL Services and Call Interface

EGL and non-EGL client

Web Service

Requester SOAP Message

WSDL

CICS TS 3.x or later

CICS

Web

Service

Runtime

Cobol Call

Channel

EGL

COBOL

Web Service

Cobol Call

Wrapper

EGL

COBOL

Service

Callable

COBOL/EGL

Program

Service Invocation

WebSphere

Call Interface Based

Option 3A and 3B

EGL

Client

CICSECI or CICS J2C

22

IBM Software Group | Rational software

EGL

Services for CICS (Option 3A)

 EGL also has the concept of an EGL service

 Which is:

 Accessing the generated service directly using

– CICS ECI (remote invocation)

– CICS JCA/J2C (remote invocation)

– COBOL Calls

 From EGL Web Service Client

– EGL generated Java under WAS (libraries/services/jsfHandlers)

– EGL generated Java running outside WAS

– EGL generated COBOL running as 3270/CICS Batch programs in CICS

 With remote invocation (CICS ECI or CICS J2C)

 No XML parsing

 No WSDL processing

 Can utilize Channels and Containers

 Data can be dynamic length (dynamic arrays, in and out types, etc)

 EGL handles the data conversion

 Should be better performance (less parsing)

 Can use same generated EGL Service code as used through Web Services

 i.e. no re-generation required

23

IBM Software Group | Rational software

EGL Services vs Web Services – Controlled via Web Client Bindings

 You can create multiple Web

Client Bindings

 Allows you to create multiple ways for the services to be invoked and

 Allows service client to determine which protocol to use by

 Referencing name in the service/interface declaration using “ bindingKey ”

24

IBM Software Group | Rational software

EGL Clients – Calling COBOL/EGL Programs – Option 3B

Standard EGL Call statement identifies the program

 Call “myprog” (parm1, parm2,…);

 Parameters:

 Can be items and/or records (up to 30)

 Passed as values across network

 Converted to pointers on mainframe as needed

 Data converted on Client side before sending to mainframe

 All are treated as in/out parameters (sent both ways)

 CICS and IMS…total records can only be 32K unless channel/containers used

 Data received using normal “linkage” methods for target program

EGL communications layer

Provides the interface to various target specific communication protocols

Developer does not need to know anything about:

 APIs to make the remote call

 How the call is physically implemented

 Anything about conversions

The details of making the connection to the remote system are specified in an

EGL “build file” through a linkage options part

25

IBM Software Group | Rational software

EGL Clients – Calling COBOL/EGL Programs – Option 3B

 Shows existing called programs in name space.

 Resulting code

26

IBM Software Group | Rational software

RBD/EGL SOA Integration with COBOL – Call Interfaces

z/OS

Client

AIX/Linux/zOS

WAS web

Services

CTG Server

DB2

WAS server

TCP/IP

MRO/EXCI

EGL Generated

Web Service code

Call Programx

J2C Config

EGL

Generated

ProgramX

Or

Native

COBOL

Programx

CICS

CTG Server

 Web Service is created using EGL wizard based on already created EGL Programx

 No additional coding needed by programmers…just develop called program and generate needed artifact

 CTG Server can reside on distributed or z/OS system… not needed on both .

27

IBM Software Group | Rational software

Linkage Options Build Part Editor – Specifying the linkage option

EGL Build File

1

1.

Build Descriptor must associate the linkage options to use (this does not happen by default!)

So can be different ones for debugging vs deployment if you have different build descriptors

Program callLink applies to

Type of callLink

Properties vary by type

28

IBM Software Group | Rational software

Example calling COBOL/CICS from via Java J2C

WebSphere Application Server

1

2

LAB5SER

Called

Program)

CICS

3

29

IBM Software Group | Rational software

RBD/EGL SOA Integration with COBOL – Which option?

Description

Required

Development Tool

Infrastructure

Other Factors

Option 1

Create WSDL using RDz and use EGL to invoke this WSDL (service)

Option 2

Use EGL to create CICS

Based web Services

Option 3:

Use Application Server for Web Service and call

COBOL pgm

Rational Developer for zSeries with EGL

CICS Web Service

 Does not require a separate application server

 Allows use of “native”

COBOL tooling (RDz) to build required artifacts

 Separate client technology tool needed

Rational Business

Developer

CICS Web Service

 Does not require a separate application server

 Allows development of client, service, and interaction with native program in single tool

(RBD)

 Defined EGL records can be used.

Rational Business

Developer

WAS (application server)

CICS Transaction

Gateway

 Allows use of existing application server if already in place

 Supports both binary

(CICSJ2C) AND SOAP based web service from same generated artifacts

 EGL Records can be used or created from

COBOL copybooks

(native COBOL)

30

IBM Software Group | Rational software

Let’s drill down a little more

31

IBM Software Group | Rational software

Services Considerations

 Services can represent a grouping of business logic:

 Each function in service is a piece of logic related to the group

E.g. AccountService

– GetAccount

UpdateAccount

– DeleteAccount

– Etc.

 One function can combine multiple business functions

 More on this in following slides

 Make sure you use exception handling for calls to host programs

 Use UI records (type basicRecords) on calls from RUI Handlers to service functions. Use different records (if needed) to call back to host programs.

32

IBM Software Group | Rational software

How would the “call” be used in a service

Example: Change Amortize to call a program (on CICS) instead of calculating within it.

 Uses 1 record to pass data between RUI handler and service (inputData) (flexible)

 Uses different record to pass data between reused called program and service (usually fixed if from

VAGen

 Can be different depending on needs

33

IBM Software Group | Rational software

Can also combine multiple calls from one service invocation

34

Summary

IBM Software Group | Rational software

 Reuse of existing CICS assets is possible

 Several ways to interact/reuse these assets

 Combination of RDz and RBD give:

 Great Flexibility in how the assets are invoked

 Ability to work within existing architectures/infrastructures

 The tools traditional programmers can use to build web services for the enterprise

35

Backup

IBM Software Group | Rational software

36

IBM Software Group | Rational software

EGL Web Services – What is generated?

Service

Requester

SOAP message

HFS pipeline config

WSDL

WSBind

CSOL

TCPIPSERVICE

CWXN

URIMAP matching

URIMAP dynamic install

PIPELINE dynamic install

WEBSERVICE

Generated by EGL

CICS TS V3.1

CPIH/User Defined Xact

Pipeline data mapping

Wrapper Pgm

Service Pgm

37

IBM Software Group | Rational software

Defining the CICS Web Services Resources

Define a TCPIPSERVICE

 For Port to listen on for SOAP requests

Define a PIPELINE

 To define the location of the

 WSDL

 WSBIND file (defines mapping of XML to data structure)

Install the PIPELINE definition and issue CEMT PERFORM PIPELINE

SCAN

 This does the following

 Locates the WSBind file

 From the WSBind file, CICS will dynamically create a WEBSERVICE resource

 CICS will also dynamically create a URIMAP definition

URIMAP

– URL to WebService mapping

Can define everything individually if preferred

38

IBM Software Group | Rational software

CICS Pipeline Definition

Configuration info

 Supplied by CICS

HFS location for CICS to store resource info

Location of:

 WSBIND

 WSDL

39

IBM Software Group | Rational software

CICS URIMAP

Created by CICS from Pipeline Definition

 URIMAP name

 Generated by CICS

 Relative Path in URL

 Transaction to Start

 Pipeline to use

 Service Name

40

IBM Software Group | Rational software

CICS WebService Definition

 Created by CICS from Pipeline Definition

Service name

Pipeline to use

URIMAP resource definition

Program to run

Wsbind/WSDL file location for data mapping

41