® ibm software group © 2009 ibm corporation egl integration with cobol and web services mark evans...

41
® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans ([email protected]) EGL Development

Upload: herbert-johnston

Post on 13-Jan-2016

224 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

®

IBM Software Group

© 2009 IBM Corporation

EGL Integration with COBOL and Web Services

Mark Evans ([email protected])EGL Development

Page 2: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

2

© 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.

Page 3: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

3

Agenda

Brief Introduction to Web Services

RBD/EGL – A tool for Building Web Services

Options for EGL Integration with COBOL Web Services

Page 4: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

4

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.

Page 5: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

5

Enterprise Modernization and Web Services

RequesterNeeds infoFrom CICS

CICS TS 3.x or Later

CallableCOBOLProgram

DB2 Or Files

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

Web Service

Page 6: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

6

Enterprise Modernization and Web Services – Getting Started

RequesterNeeds infoFrom CICS

CICS TS 3.x or later

CallableCOBOLProgram

DB2 Or Files

What’s Required?

1. 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

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

WebSphere Application Server

CICS

Tomcat

Other application servers

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

Web ServiceWebSphereWeb Service

Support

CICSWeb

ServiceRuntime

SOAP Message/WSDL

Page 7: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

7

Agenda

Brief Introduction to Web Services

RBD/EGL – A tool for Building Web Services

Options for EGL Integration with COBOL Web Services

Page 8: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

8

EGL Services Support – High Level View

EGL RUI/JSF/TUI

EGL RUI/JSF/TUI

EGLRecords

EGLRecords

EGL Service

EGL Service

Non-EGLUser of EGL Service

At development time…focus on the business logicimplement SOA design elements: Services & Interfacesleverage existing COBOL or RPG developers for new SOA developmentignore deployment targets/technology while coding/testingUse Deployment Descriptor file to describe Deployment considerations

Deploy EGL Services…in Java to Java to WAS, Tomcat, Win, Linux, HP-UX, Solaris, iSeriesin COBOL to CICS, System i

EGLRecords

EGLRecords

Existing Service

WSDL

WSDL

EGL Interface

EGL Interface

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

Create EGL Interface and EGL Records automatically based on existing WSDL

Use existing non-EGL Web Service

Build & expose EGL Web Service

WSDL

WSDL

Page 9: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

9

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 ServiceExample of an EGL Service

Page 10: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

10

EGL Interfaces - Concepts built into the language SOASOA

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 IStockQuoteServiceFunction getQuote(symbol String) returns (money);end

Service StockQuoteService implements IStockQuoteServiceFunction getQuote(symbol String) returns (money)…end

end

Page 11: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

11

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

Page 12: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

12

Agenda

Brief Introduction to Web Services

RBD/EGL – A tool for Building Web Services

Options for EGL Integration with COBOL Web Services

Page 13: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

13

RBD/EGL SOA Integration with Enterprise Programs – Options

Web Service Requester

CICS TS 3.x or later

CICSWeb

ServiceRuntime

EGLCOBOL

Web ServiceWrapper

EGLCOBOLServiceSOAP Message

Channel Cobol Call

EGLClient

EGL and non-EGL client

CICSECI or CICS J2C

Web Service BasedOption 1

RDzGeneratedHandlers

CallableCOBOL/EGL

Program

Channel

Call Statement

Service Invocation

WSDL

Cobol Call

Call Interface BasedOption 3

WebSphere

Web Service BasedOption 2

Page 14: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

14

RBD/EGL SOA Integration – Option 1 EGL Integration with RDz Generated WSDL/Handlers

Web Service Requester

CICS TS 3.x or later

CICSWeb

ServiceRuntime

SOAP Message

EGL and non-EGL client

Web Service BasedOption 1

RDzGeneratedHandlers

CallableCOBOL/EGL

ProgramChannel

WSDL

Cobol Call

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

Page 15: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

15

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

Page 16: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

16

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

Page 17: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

17

Consuming non-EGL Web Services – Resulting Definitions

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

Page 18: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

18

EGL CICS Web Service Client

Service Provider

HFS

WSDL

WSBIND

CICS TS 3.1

CICSWeb

ServiceRuntime

COBOLWeb Service

Proxy

EGL COBOLProgram

orService

(including 3270 pgms)

SOAP MessageChannelCobol Call

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

Page 19: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

19

RBD/EGL SOA Integration – Option 2 Using EGL Web Services to create new logic or wrapper existing programs

Web Service Requester

CICS TS 3.x or later

CICSWeb

ServiceRuntime

EGLCOBOL

Web ServiceWrapper

EGLCOBOLService

SOAP Message

Channel Cobol Call

EGL and non-EGL client

Web Service BasedOption 2

CallableCOBOL/EGL

Program

WSDL

Cobol Call

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

Page 20: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

20

EGL CICS Web Services – Generation Process

Deployment Descriptor file

(.egldd file)

Services Source

(.egl files)

Build Descriptor file

(.eglbld file)

Generation

Workstation z/OS

EGL Build

Server

CICS

WSBIND

WSDL

HFS

PDS w/Load

Modules

z/OS

Deployment Descriptor File WSBIND, WSDL, & Wrapper COBOL programs

Services COBOL program

Page 21: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

21

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

Page 22: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

22

RBD/EGL SOA Integration – Option 3EGL Services and Call Interface

CICS TS 3.x or later

CICSWeb

ServiceRuntime

EGLCOBOL

Web ServiceWrapper

EGLCOBOLService

Channel Cobol Call

EGLClient

EGL and non-EGL client

CICSECI or CICS J2C

CallableCOBOL/EGL

Program

Service Invocation

Cobol Call

Call Interface BasedOption 3A and 3B

Web Service Requester SOAP Message

WSDL

WebSphere

Page 23: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

23

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

Page 24: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

24

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”

Page 25: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

25

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 neededData converted on Client side before sending to mainframeAll are treated as in/out parameters (sent both ways)CICS and IMS…total records can only be 32K unless channel/containers usedData received using normal “linkage” methods for target program

EGL communications layer

Provides the interface to various target specific communication protocolsDeveloper does not need to know anything about:

APIs to make the remote callHow the call is physically implementedAnything about conversions

The details of making the connection to the remote system are specified in an EGL “build file” through a linkage options part

Page 26: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

26

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

Shows existing called programs in name space.

Resulting code

Page 27: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

27

RBD/EGL SOA Integration with COBOL – Call Interfaces

WAS server

EGL Generated Web Service

code

Call Programx

DB2

z/OS

Client WAS web Services

J2C Config

AIX/Linux/zOS

CICS

EGL Generated ProgramX

Or

Native COBOL

Programx

Tcp

ipservice po

rt

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.

CTG Server

CTG Server

TCP/IPMRO/EXCI

Page 28: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

28

Linkage Options Build Part Editor – Specifying the linkage option

EGL Build File

Properties vary by type

Program callLink applies to

Type of callLink

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

Page 29: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

29

Example calling COBOL/CICS from via Java J2C

LAB5SERCalled

Program)

CICS

1

WebSphere Application Server

23

Page 30: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

30

RBD/EGL SOA Integration with COBOL – Which option?

Option 1 Option 2 Option 3:

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

Use EGL to create CICS Based web Services

Use Application Server for Web Service and call COBOL pgm

Required Development Tool

Rational Developer for zSeries with EGL

Rational Business Developer

Rational Business Developer

Infrastructure CICS Web Service CICS Web Service WAS (application server)

CICS Transaction Gateway

Other Factors Does not require a separate application server

Allows use of “native” COBOL tooling (RDz) to build required artifacts

Separate client technology tool needed

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.

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)

Page 31: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

31

Let’s drill down a little more

Page 32: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

32

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.

Page 33: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

33

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

Page 34: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

34

Can also combine multiple calls from one service invocation

Page 35: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

35

Summary

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

Page 36: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

36

Backup

Page 37: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

37

EGL Web Services – What is generated?

HFS

WSDL

WSBindWEBSERVICE

pipelineconfig

URIMAP

CICS TS V3.1TCPIPSERVICE

CPIH/User Defined XactCWXNService

Requester

URIMAPmatching

CSOL

Pipeline

SOAP message

data mapping

Wrapper Pgm

dynamicinstall

dynamicinstall

PIPELINE

Service Pgm

Generated by EGL

Page 38: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

38

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

Page 39: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

39

CICS Pipeline Definition

Configuration info Supplied by CICS

HFS location for CICS to store resource info

Location of:WSBIND

WSDL

Page 40: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

40

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

Page 41: ® IBM Software Group © 2009 IBM Corporation EGL Integration with COBOL and Web Services Mark Evans (evansm@us.ibm.com) EGL Development

IBM Software Group | Rational software

41

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