Upload
polly-bradley
View
226
Download
0
Embed Size (px)
Citation preview
®
IBM Software Group
© 2009 IBM Corporation
Web Services – An IntroductionWeb Services – An Introduction
Leigh Compton – Certified IT Specialist – CICS, Web Services and JavaDavid Myers – RDz PLM
2
IBM Trademarks and Copyrights
© Copyright IBM Corporation 2007, 2008, 2009, 2010. 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.
3
Services are the driving business system design paradigm of the day.
Services – Generated by RDz provide a cross platform language for business oriented development
Services and SOA are based on the concept of “Service Oriented Design”
ExternalWebService
WSDLRDz
Records
RDz Service
RDz Service
WSDL
RDz Interface
RDz Interface
RDz SOA for WAS, CICS, System i
At development time… Focus on the business logic Implement SOA design elements: services and interfaces Leverage existing business developers for new SOA
development Ignore deployment targets/technology while coding/testing
Deploy Web Services…To any platform Java to WAS/Tomcat/etc. COBOL to CICS, iSeries
As… A Web Service (uses SOAP) A private service (uses CICS ECI, J2C, or TCP) Other SOA runtimes when they reach critical mass
Leverage external web services… Service Interfaces
Represent external web services Are created via import from WSDL Allow the RDz developer to stay within the context of the RDz programming model
External Applications
Deploy Services as Web ServicesDeploy Services as Web Services
Consume external servicesConsume external services
The Promise of Services and SOA (Service Oriented Architecture)
© 2008 IBM Corporation4
At a Very High LevelAt 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:
Intermediary Function
Simple forwarding
or
Complex message transformation and protocol remapping
Passing of an agreed-to request in
message format
Return of information in the form of an agreed-to message response
© 2008 IBM Corporation5
What’s Behind This … Why Are We Talking About ThisWhat’s Behind This … Why Are We Talking About ThisOver the years our application systems have become very complicated, with tightly-coupled relationships that are often little understood.
Actual application architecture Actual application architecture map from real-life customer map from real-life customer
Changes to any part of this are …
• Difficult to determine what impact there is on other components
• Expensive to analyze, often expensive to implement
• Delays often result in missed opportunities
Two objectives: eliminate tight (hard-coded) interconnections, and create a way for one program to dynamically seek, find, and bind to another.
Two basic problems:
1. Inflexible connectivity definitions (hard-coded, deeply imbedded in code)
2. Knowledge of relationships lost over time
Possible third: duplication of resources because reuse
difficult in this environment
© 2008 IBM Corporation6
A “Service” – Conceptual DefinitionA “Service” – Conceptual DefinitionA discrete set of business or technical functionality that can be identified, has a defined set of input and outputs, and is reusable
User“Consumer”
Service“Producer”Input
Output
Discrete – can be contained within a definite and known “fence”Identified -- it’s recognized as a service and people acknowledge it as a serviceDefined – the input and the outputs are known and understoodReusable – is not just a one-time thing
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
Inte
rfac
eImplementation
Exactly how the service is implemented behind the interface doesn’t really matter to the
consumer of the service
© 2008 IBM Corporation7
An Example - Currency ExchangeAn Example - Currency Exchange
IBM’s Travel Expense Reimbursement application does not do its own foreign currency conversions … it uses an external service for that:
Currency = $US?
Inte
rfac
e
Implementation$US
No
YesInternet
[ £100,$US,15-June ]
[ $196.00 ]
For this to work, several things need to be in place:• IBM application needs to know about the service and where it is located• IBM application needs to know the interface requirements: parameters, sequence, format
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.
© 2008 IBM Corporation8
Another Example - CICS Web ServiceAnother Example - CICS Web ServiceWe’ve not really defined what a “web service” is … but for now be aware that CICS has the ability to front-end existing CICS programs with a web service interface … “exposing” the CICS program as a service:
CICS Web Service
Front-End
Existing CICS
Program
CICS V3.1
NetworkWeb Service
Client Program
CICS program unchanged
Appl
3270EXCI
Traditional access unaffected
New front-end allows service
oriented invocation
SOAP/HTTP
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
Inte
rfac
e
© 2008 IBM Corporation9
Service Oriented ArchitectureService Oriented Architecture
Service oriented architecture Service oriented architecture (SOA) is a business-driven IT (SOA) is a business-driven IT architectural approach that architectural approach that supports integrating the supports integrating the business as linked, repeatable business as linked, repeatable business tasks, or services.business tasks, or services.
From www.ibm.com
An exact definition is probably not all that important. It's more important to understand:
• The concept of a “service”
• The implied value of a loosely coupled “service” rather than a tightly coupled connection to another application’s interface … flexibility
• That “SOA” is a path towards the use of more and more services in your I/T architecture … not a “thing” or an “all-at-once” proposition
• That there’s more to it than just services.
© 2008 IBM Corporation10
CICS is an Application CICS is an Application ServerServerCICS is a system that hosts applications, and provides a rich set of “services” which the applications may make use of:
CICS Services
External Data Resources“EXEC CICS” API C++ classes for CICS JCICS classes for Java
“CICS Programs”COBOL
C/C++
PL/I
AssemblerJava EJBs
CICS EJB Support(transparent mapping)
CICS
ProgramAccess
JVMs
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.
These are the “existing assets” we’re looking to “expose” as services
© 2008 IBM Corporation11
Provider vs. Requester -- CICS Can Do BothProvider vs. Requester -- CICS Can Do Both
CICS as a Web Service Provider …
We typically consider CICS as a provider of web services:
Web Service Client
Appl
CICS
But it can also be a consumer (or requester) of web services:
Appl
CICS
Web Service Client
This web service could be anywhere accessible to CICS -- inside your company or outside
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.
The case where existing (or new) CICS applications are exposed as reusable services.
External Service
© 2008 IBM Corporation12
CICS as a Web Services ProviderCICS 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
Ability to act upon the request
This is the “behind the interface” implementation we’ve shown before
HTTP
MQ
Built-in SOAP Handler
Custom Program
CICS Transaction
CICS
This is defined within something called a “Pipeline,” which is a structure within CICS that invokes your customized program(s).
This is what does the mapping of XML to application data structure and invokes the CICS transaction.
© 2008 IBM Corporation13
CICS Web Services Development ToolsCICS Web Services Development Tools
There are two primary tools used to develop CICS web services:
1. CICS Web Service AssistantConsists of a set of JCL batch utilities that generate program components
DFHLS2WS – Transforms a language structure into a Web Service Binding File and a Web Service Description (WSDL). Use this to put a web service front end on an existing application.
DFHWS2LS - Generates a Web Service binding file from a Web Service description (WSDL). This utility also generates a language structure that you can use in your application programs. Use this to create a new CICS application based on a WSDL, or to enable CICS to be a web service requester
2. Rational Developer for System z (RDz)2. Rational Developer for System z (RDz)An Eclipse-based tool for zSeries development (not just web services), it does what CICS Web Service Assistant does with additional flexibility and capabilities.
RDz is the more powerful alternative.
CICS Web Service Assistant should only be used for basic web services enablement and when Eclipse expertise is lacking
© 2008 IBM Corporation14
What’s Produced by RDz for Web ServicesWhat’s Produced by RDz for Web Services
The process of creating and defining a Web Service to CICS
z/OS System
COBOL source, including COPYBOOK of existing
CICS application
COBOL source to our new handler, which converts SOAP XML-to-COMMAREA and vice-versa
WSBINDWSBIND file, which is a binary file that contains information about the service, including the “URI MapURI Map” that triggers the execution of the pipeline and web service
RDz
Import into RDz
Run through the creation
wizardsCompile this into the CICS LOADLIB
Optional used to define the CICS pipeline entriesMore complex scenarios can
occur, of course. But this illustrates some essential elements of the process
Transfer down to RDz
Using simple drag-and-drop capability
Transferback
15
The Importance of XML in Web Services
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?What is XML, and why is it valuable?
<SOAP-ENV:Envelope>
<SOAP-ENV:Body>
<q0:DFHCOMMAREA>
<CustNo>3</CustNo>
</q0:DFHCOMMAREA>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
A series of “tags” that mark the beginning and end of blocks of XML
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 data.
It is both machine readable and human readable, which makes things relatively easy to understand
Contrast with bit-format protocols, where bits within bytes meant certain things. Machine readable yes; human readable less so.
Characters use “Unicode” encoding, which means it’s universally understood
As opposed to the old EBCDIC vs. ASCII debatesExample of XML SOAP envelope
we’ll use in one of the labs
XML can be “parsed”XML is “Self Describing”Something called a “Schema Definition” (XSD) is used to tell a program what XML tags to expect.
The WSDL file (more in moment) has XSD information
If a program knows what tags to expect (the WSDL supplies this),
then the program can “parse” (extract) information from the XML.
16
“SOAP over HTTP”
The Web Service Description Language (WSDL) file …
<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> </q0:DFHCOMMAREA> </SOAP-ENV:Body></SOAP-ENV:Envelope>
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
Web Service Client
Web Service Provider
HTTP Protocol(TCP/IP Network)
XML File
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.
The SOAP input for our CICS lab
Knowing the layout is not that important to us at this point
17
The WSDL File
Where does WSDL come from? …
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
<SOAP-ENV:Body> <q0:DFHCOMMAREA> <CustNo>3</CustNo> </q0:DFHCOMMAREA></SOAP-ENV:Body>
Web Service Client
<complexType name="DFHCOMMAREA"> <sequence> <element name="CustNo"> <simpleType> <restriction base="int"/> </simpleType> </element> </sequence></complexType>
<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>
What service will return was here … removed to save space
Web Service Provider
Client knows input XML and data requirements based on this
Client knows where service is located based on this
18
WSDL File is a Product of RDz
You could hand-code the WSDL.
More likely you’ll use a development tool (in our case, RDz) to create the web service, and RDz will also produce the WSDL.
Web Service Client
Web Service ProviderService Program
WSDL File• Rational Application Developer• WebSphere Developer for zSeries• Other Development Tools
With WSDL, client knows where service is and how to drive it
19
That's all well and good, but what about performance?
http://listserv.uga.edu/cgi-bin/wa?A2=ind0908&L=CICS-L&D=0&P=30338
That’s .1 secondThat’s .1 second1/10th of a second1/10th of a second
Any other questions about "Why Web Services"?Any other questions about "Why Web Services"?
20
Legacy
Data Abstraction
Data Services/Messaging
Services
Process/Orchestration
Monitoring/Event Management
Security
Governance
RepData
SQL/XQuery/XML
J2EE/JCA (EJB)
Source: Linthicum Group
IMSAppIMSAppIMSApp
J2EE/JCA(EJB)
SOAP/J2EEIMS Database Web Services
IMSDB
Service Oriented Architecture Model – and IMS
21
IMS On Demand Overview
Web
Serv
ice
.NET Client
Client Developer
Application developer
SAP Client
Web service clients
Java/J2EE Client
Java dev
Direct Database access
Developers
Java /J2EE Developer
CICS Developer
DB2 Developer
Java class Library
Direct SOAP
IMS SOAP Gateway
WDz
Solutions
WID RAD
IMS TM Resource Adapter
MFS Web Services
WebSphere
Solutions
DLI Model Utility
DLI Model Utility
DB2 SP/CICS
Java class
Library
Java class
Library
WebSphere
IMS DB Resource Adapter
IMS
Database
IMS
Co
nn
ect
OD
BA
/DR
ASQL
XQueryDL/I
DL/ISOAPTCP/IP
Java class Library
Transaction manager
IMS APP
Database manager
DLI Model Utility
22
App
IMSTM
CO
NN
EC
T
IMSDB CTRL
z/OS
TCP/IP Access to IMS
23
Architecture Foundation - IMS Connect
A capability that provides connectivity support between TCP/IP applications and IMS transactions – Integrated into IMS V9
Configured on a z/OS server
Benefits and Value Supports TCP/IP sockets access to IMS transactions and commands Provides a general purpose and structured interface Provides a strategic base for new connection technologies:
Operations Manager – IMS Control Center IMS SOAP Gateway MFS Web Services
IMSAIMS Connect
IMSB
VTAM
TCP/IP
Java Applet
BROWSER
Web Server
COMTIVisual BasicPowerBuilder...
Web Server program
Websphere
CobolAssemblerC/C++Java
24
App
IMSTM
CO
NN
EC
T
IMSDB CTRL
z/OS
App
TM RA
WebSphere
IMS TM Resource Adapter
25
J2EE/JCA Architecture
ApplicationComponent
Security Management
Transaction Management
Connection Management
J2EE Application Server
EIS
Application Contract
EIS-specific interface
System Contracts
Container-ComponentContract
SPI (service provider interface)
CCI (common client Interface)
ResourceAdapter
26
PLI
IMS TM Resource Adapter …
Supports the development of J2EE applications, Web services, and business processes that can interface with IMS Connect
Development component– Rational Developer for System z – RDz
Runtime component – Must be installed into an application server, e.g., WebSphere
WebSphereUnit Test
Environment
IMS RESOURCEADAPTER
IMS SERVICE
DEPLOY& TEST
IMPORTC
COBOL
RDz
IMS RESOURCEADAPTER
imsico.RAR
Appl.EARJ2CConnectionFactory
IMS
IMSConnect
InstalledApplications
TCP/IP
WebSphere Application Server
Export
(supplied with IMS Connect)
Toolkits that generate web services, EJBs, JSP, etc. for IMS, CICS, DB2
Java Applet
BROWSER
27
27
© Copyright IBM Corporation 2010. 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. 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, Rational, the Rational logo, Telelogic, the Telelogic logo, and other IBM products and services are 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.
Learn more at:IBM Rational softwareRational launch announcementsRational Software Delivery PlatformAccelerate change & deliveryDeliver enduring qualityEnable enterprise modernization
Rational trial downloadsdeveloperWorks RationalLeading InnovationIBM Rational TVIBM Business PartnersIBM Rational Case Studies
Ensure Web security & complianceImprove project successManage architectureManage evolving requirementsSmall & midsized businessTargeted solutions