Professional Documents
Culture Documents
2
Course Contributing Authors
Thanks to the following individuals, for assisting with this course:
David Myers/IBM
Bill Klein
Reginaldo Barosa
Mike Wrzinski/Sentry Insurance
3
Purpose of This Document
Course Name: COBOL Foundation Training - with RDz
Course Description: Learn the COBOL language, RDz and learn z/OS terms, concepts and development skills in this course.
Pre-requisites: Some experience in a 3rd or 4th Generation Language is expected. SQL is also recommended.
Prerequisites
This course assumes that the student has a basic understanding and knowledge
of software computing technologies, and general data processing terms,
concepts and vocabulary.
Knowledge of SQL (Structured Query Language) is assumed for database
access is assumed as well.
Basic PC and mouse-driven development skills, terms and concepts are also
assumed.
Note that we will be covering RDz's mainframe-editor-compliant function key idiom in
this unit
5
Unit
RDz and Services
(SOA)
Topics:
XML and Web Services Terms and Concepts
RDz and Web Services
Setting up for Web Services
Creating and consuming an RDz Web Service
Consuming a 3rd Party Web Service
6
Topic objectives
After completing this topic, you should be able to:
Describe the foundation SOA terms and vocabulary:
Service
Service Oriented Architecture
Web Service
Describe the role CICS can play, in a Service Oriented Architecture
Define the purpose of XML
Differentiate between:
Service
WSDL
XML
SOAP
Describe the role RDz plays in doing work with Web Services
7
The Promise of Services and SOA (Service Oriented
Architecture)
Services are the driving business system design paradigm of the day.
Services and SOA are based on the concept of “Service Oriented Design”
At development time… Leverage external web services…
Focus on the business logic Service Interfaces
Implement SOA design elements: services and interfaces Represent external web services
Leverage existing business developers for new SOA Are created via import from WSDL
development Allow the RDz developer to stay within the
Ignore deployment targets/technology while coding/testing context of the RDz programming model
External Applications
8
At a Very High Level
What we’re ultimately getting at here is a decoupling of application requester
from the application provider. And the placement of an intermediary function
to make things more flexible and dynamic:
Passing of an agreed-
to request in
Intermediary
message format Function
Simple forwarding
or
Complex message
transformation and
protocol remapping
Service
Input “Producer”
Interface
User Exactly how the service
“Consumer” is implemented behind
the interface doesn’t
Implementation
really matter to the
Output
consumer of the service
There’s nothing revolutionary about this. What’s different is that we’re coming to a point
where improvements in technology have allowed us to do this better than before:
• Settled on a universal and common networking protocol -- TCP/IP
• Networking bandwidth is increasingly available, cheap and reliable
• The idea of “industry standards” has matured and is embraced rather than resisted
• Java as a platform-unaware language has opened up a new world of interoperability
No
Currency = $US? [ £100,$US,15-June ]
Interface
Internet
Yes
$US [ $196.00 ]
Implementation
Could IBM have coded an internal subroutine to do currency conversions? Sure. But very good
converters exist on the web and in this case IBM took advantage of them.
Understanding what services are available, where they’re located and what
interface requirements they have is a key aspect of SOA.
EXCI 3270
CICS V3.1
SOAP/HTTP
Interface
CICS Web Existing
Web Service Service CICS CICS program
Client Network unchanged
Front-End Program
Program
New front-end
allows service
oriented
invocation
Key point is that a traditional CICS program can be turned into a message based
“service” which can then be used by “service consumers” in your network
External Data
“EXEC CICS” API C++ classes for CICS JCICS classes for Java
CICS EJB Support Resources
(transparent mapping)
CICS Services
There are many ways to access programs running in CICS -- 3270 terminal,
EXCI or EPI, RMI/IIOP, MQ, HTTP. Our focus here is going to be accessing via
Web Services.
Web CICS
Service The case where existing (or new)
Client CICS applications are exposed as
Appl reusable services.
External
CICS Service
We’ll focus on the top one for the most part. The concepts you’ll see are mostly
applicable to both environments. See “CICS Web Services Guide” (SC34-6458) for more.
CICS as a Web Service Provider …
© 2008 IBM Corporation
16
CICS as a Web Services Provider
Three basic requirements of being a Web Services provider:
Ability to receive the SOAP request
Standard ways: SOAP/HTTP or SOAP/JMS
Ability to read and understand the contents of the SOAP request
XML parser along with implementation of the “WS-basic” standards
CICS
HTTP
Built-in SOAP Custom CICS
Handler Program Transaction
MQ
to RDz
r down bility
Transfe d -dr op capa
imple d
rag-an z/OS
RDz Using s
System
Run through
the creation Tran
sfer
wizards back
COBOL source to our new Compile this into
handler, which converts SOAP the CICS LOADLIB
XML-to-COMMAREA and vice-
versa
WSBIND file, which is a binary file Optional used to
that contains information about the define the CICS
More complex scenarios can service, including the “URI
URI Map”
Map that pipeline entries
occur, of course. But this triggers the execution of the pipeline
and web service
illustrates some essential
elements of the process
You will see that XML is the common mechanism to exchange information in a
web services environment. What is XML, and why is it valuable?
A series of “tags” that mark the beginning and end of
<SOAP-ENV:Envelope> blocks of XML
<SOAP-ENV:Body> It holds both the data, as well as description of the data
<CustNo> provides an indicator of what the data is; “3” is the actual
<q0:DFHCOMMAREA> data.
<CustNo>3</CustNo> It is both machine readable and human readable, which
</q0:DFHCOMMAREA> makes things relatively easy to understand
Contrast with bit-format protocols, where bits within bytes meant certain
</SOAP-ENV:Body> things. Machine readable yes; human readable less so.
20
“SOAP over HTTP”
You’ll frequently hear this phrase. What it’s referring to is the passing of an
XML document -- a SOAP “envelope” -- using the HTTP protocol
HTTP Protocol
(TCP/IP Network)
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:q0="http://www.WBCSCUSTI.com/schemas/WBCSCUSTIInterface"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<SOAP-ENV:Body>
<q0:DFHCOMMAREA>
<CustNo>3</CustNo> The SOAP input for our CICS lab
</q0:DFHCOMMAREA> Knowing the layout is not that important to
</SOAP-ENV:Body> us at this point
</SOAP-ENV:Envelope>
The key is that the client program knew what the provider expected -- what data
elements and what XML tags to use. How did it know that? It had the WSDL file.
21
The WSDL File
WSDL contains information about the service -- where it’s located, what
parameters it takes as input, what it gives back as output, what XML tags to
use, etc. It is sometimes known as a “bindings file”.
It can be long and complicated … what follows is a boiled-down snippet to show essence
<complexType name="DFHCOMMAREA">
<sequence>
<element name="CustNo">
<simpleType>
<restriction base="int"/> Client knows input XML and
</simpleType> data requirements based on this
</element>
</sequence>
</complexType> Client knows where service
What service will return was here … removed to save space
is located based on this
<wsdl:service name="WBCSCUSService">
<wsdl:port binding="tns:WBCSCUSBinding" name="WBCSCUSPort">
<soap:address location="http://mig.null.washington.ibm.com:12301/WBCSCUST"/>
</wsdl:port>
</wsdl:service>
Web Service
<SOAP-ENV:Body>
Provider
<q0:DFHCOMMAREA>
<CustNo>3</CustNo>
Web Service </q0:DFHCOMMAREA>
Client </SOAP-ENV:Body>
22
WSDL File is a Product of RDz
Web Service
Service Program Provider
23
That's all well and good, but what about
performance? That’s .1 second
http://listserv.uga.edu/cgi-bin/wa?A2=ind0908&L=CICS-L&D=0&P=30338
1/10th of a second
24
Topic objectives
After having completed this topic, you now should be able to:
Describe the foundation SOA terms and vocabulary:
Service
Service Oriented Architecture
Web Service
Describe the role CICS can play, in a Service Oriented Architecture
Define the purpose of XML
Differentiate between:
Service
WSDL
XML
SOAP
Describe the role RDz plays in doing work with Web Services
25
Unit
RDz and Services
(SOA)
Topics:
XML and Web Services Terms and Concepts
RDz and Web Services
Setting up for Web Services
Creating and consuming an RDz Web Service
Consuming a 3rd Party Web Service
26
UNIT RDz Introduction
Topics:
• The RDz Workbench – Terms and Concepts
27
Service Oriented Design – Concepts
Service Orientated Design is a software design paradigm that encourages the creation of functionally discrete (modular) business logic,
composed of standardized software components (logic routines and subroutines with standard interfaces)
Services are formally declared with a standard network interface that allows them to be invoked by other services that only know the interface.
Also, services:
May be created at various levels of business/technical granularity (i.e. low-level vs. high-level)
Can be assembled/combined (“choreographed”) to create higher-level business functionality
Can be deployed to any platform – independently – and called from any platform through their network interface
28
What is a Service? Network Interface Definition
“A Web Service is a network interface to programs that live on a particular machine implemented in such
a manner that any other program (or many programs) running on any other machine, written in any
language, and running on any OS can call it.”
Additionally:
Services are an abstract design pattern - they are not the same as Web Services In fact, a service can be implemented using a number of different technologies, including:
.
29
Creating and Consuming Services – WSDL Files and RDz Generation
You want to code COBOL, PL/I and HLASM business logic – exactly as you’ve done all along in this course
So in fact, the RDz tooling will generate all of the “plumbing” for you – when you create or consume Web Services:
When you create an RDz service, the tooling generates WSDL files, so you will not need to learn XML (and other low-level languages, terms and concepts)
When you consume a service, RDz generates RDz Interfaces from existing WSDL files for you – automatically
30
Reusing Existing Application Resources
Application Aggregation …
31
Different Architectural Approaches to CICS and Web Services
WebSphere z/OS
HATS
CICS
Applications
BMS (3270)
1
TN3270
2
Web EXCI
Service
Client Java
Applications
COMMAREA
SOAP/HTTP
SOAP/MQ
3
1. SOAP/HTTP to Host Access Transformation Services (HATS), an application that runs in WebSphere and provides
a web service interface (or browser interface) for BMS (3270) applications in CICS
2. SOAP/HTTP or SOAP/JMS to custom web service running in WebSphere.
3. Web service interface running inside of CICS, and accessed either through CICS HTTP listener (or MQ)
32
The COBOL Café and Rational - z/OS Product
Training from IBM
http://www-949.ibm.com/software/rational/cafe/community/cobol