EGL Integration with Web Services
Download
Report
Transcript EGL Integration with Web Services
© 2009 IBM Corporation
IBM Software Group
EGL Integration with COBOL and Web Services
Mark Evans ([email protected])
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
CICS TS 3.x or Later
Requester
Needs info
From CICS
Web Service
Callable
COBOL
Program
DB2
Or
Files
5
IBM Software Group | Rational software
Enterprise Modernization and Web Services – Getting Started
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.
3.
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
CICS
Web
Service
Runtime
Callable
COBOL
Program
DB2
Or
Files
SOAP Message/WSDL
Requester
Needs info
From CICS
Web Service
WebSphere
Web Service
Support
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
Interface
EGL
Records
EGL
Records
EGL
Service
W
S
D
L
Build & expose EGL Web Service
Non-EGL
User of
EGL Service
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
SOA
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
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
CICS TS 3.x or later
Web Service Based
Option 1
Channel
Web Service Based
Option 2
EGL and non-EGL client
CICS
Web
Service
Runtime
Callable
COBOL/EGL
Program
Cobol Call
Channel
Web Service
Requester
RDz
Generated
Handlers
SOAP Message
EGL
COBOL Cobol Call
Web Service
Wrapper
EGL
COBOL
Service
WSDL
Service Invocation
WebSphere
Call Interface Based
Option 3
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
Web Service
Requester
SOAP Message
CICS TS 3.x or later
CICS
Web
Service
Runtime
Channel
RDz
Generated
Handlers
Callable
COBOL/EGL
Program
Cobol Call
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)
4.
Location of source
Which functions to interface with
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
Service
Provider
HFS
WSDL
WSBIND
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
CICS TS 3.x or later
Web Service Based
Option 2
Web Service
Requester
SOAP Message
WSDL
EGL and non-EGL client
CICS
Web
Service
Runtime
Callable
COBOL/EGL
Program
Cobol Call
Channel
EGL
COBOL Cobol Call
Web Service
Wrapper
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
HFS
WSBIND
(.egldd file)
WSDL
Build Descriptor file
EGL Build
(.eglbld file)
Server
CICS
Generation
Services Source
z/OS
(.egl files)
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
CICS TS 3.x or later
EGL and non-EGL client
Callable
COBOL/EGL
Program
CICS
Web
Service
Runtime
Cobol Call
Channel
Web Service
Requester
SOAP Message
EGL
COBOL Cobol Call
Web Service
Wrapper
EGL
COBOL
Service
WSDL
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
AIX/Linux/zOS
Client
DB2
CTG Server
WAS web
Services
WAS server
TCP/IP
Call Programx
J2C Config
Tcpipservice port
EGL Generated
Web Service
code
MRO/EXCI
CTG Server
EGL
Generated
ProgramX
Or
Native
COBOL
Programx
CICS
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
Program callLink
applies to
1.
Type of callLink
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
Properties vary
by type
28
IBM Software Group | Rational software
Example calling COBOL/CICS from via Java J2C
WebSphere Application Server
1
LAB5SER
Called
Program)
2
3
CICS
29
IBM Software Group | Rational software
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
Does not require a
separate application
server
Allows use of existing
application server if
already in place
Allows use of “native”
COBOL tooling (RDz) to
build required artifacts
Allows development of
client, service, and
interaction with native
program in single tool
(RBD)
Supports both binary
(CICSJ2C) AND SOAP
based web service from
same generated artifacts
Separate client
technology tool needed
Defined EGL records
can be used.
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
IBM Software Group | Rational software
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
35
IBM Software Group | Rational software
Backup
36
IBM Software Group | Rational software
EGL Web Services – What is generated?
TCPIPSERVICE
SOAP message
Service
Requester
CSOL
CWXN
CICS TS V3.1
CPIH/User Defined Xact
Pipeline
URIMAP
matching
HFS
pipeline
config
WSDL
URIMAP
dynamic
install
PIPELINE
data mapping
Wrapper Pgm
dynamic
install
WSBind
WEBSERVICE
Service Pgm
Generated by EGL
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