Upload
buihuong
View
219
Download
1
Embed Size (px)
Citation preview
®
IBM Software Group
2014 © IBM Corporation
z/OS GSE Brussels 2014
Mainframe to Mobile in 1 hour
Peter Siddell – Senior IT Specialist
IBM Software Group | WebSphere software
2
Agenda
Enterprise systems offer integrity, rollback, durability and thousands of other characteristics that make your business run without error 24/7 -- but enterprise systems also have a reputation for "hiding" their data from the mobile platform.
So imagine what you could accomplish if in just one hour you could easily expose enterprise back-end data to a mobile interface.
IBM Software Group | WebSphere software
3
Please Note:
IBM’s statements regarding its plans, directions, and intent are subject to change or withdrawal without notice at IBM’s sole discretion.
Information regarding potential future products is intended to outline our general product direction and it should not be relied on in making a purchasing decision.
The information mentioned regarding potential future products is not a commitment, promise, or legal obligation to deliver any material, code or functionality. Information about potential future products may not be incorporated into any contract. The development, release, and timing of any future features or functionality described for our products remains at our sole discretion.
Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user’s job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
IBM Software Group | WebSphere software
4
Agenda
� The Worklight Platform
� Introduction to JSON and REST
� CICS REST and JSON support
Agenda
IBM Software Group | WebSphere software
5
61%of CIOs put mobile as priority
increased productivity with mobile apps45%
10 Billiondevices by 2020
Mobile is a mandatory transformation
IBM Software Group | WebSphere software
6
From the complexity of many+
•Multiple sets of tools & frameworks •Four codebases to develop and maintain
To the simplicity of one
• One development environment• One codebase to develop and maintain
IBM Worklight
Windows AndroidApple Blackberry
Multi-platform development with a shared codebase
IBM Software Group | WebSphere software
7
From multiple point-to-point integrations
•Multiple sets of integrations to enterprise resources to build and maintain
•YOU manage caching, synchronization and end-to-end encryption
To streamlined, transparent access
•Worklight transforms enterprise data into mobile-friendly, JSON format
•Worklight Server manages caching, data synchronization and end-to-end encryption
ERP
EngineApp DB
HTTP (REST, SOAP), JMS
SQL SAP
HTTP, CAST IRON
JSON
Worklight Adaptors
WORKLIGHT
SERVER
ERP
EngineApp DB
CloudService
CloudService
BlackberryApple
BlackberryApple
Controlled back-end integration
IBM Software Group | WebSphere software
8
• Efficient deployment of development artifacts to stakeholders for test and feed-back
• Easier employee enablement for up to date mobile apps access
• Advanced control via ACL and LDAP support
WORKLIGHT
SERVER
Worklight AppCenter
BlackberryApple
One App Store for all of your devices
IBM Software Group | WebSphere software
9
En
terp
rise B
acken
d S
yste
ms &
E
nte
rpri
se B
acken
d S
yste
ms &
Clo
ud
Serv
ices
Clo
ud
Serv
ices
Worklight Server
User authentication and
mobile trust
Mashups and service
composition
JSON Translation
Adapter Library for
backend connectivity
Sta
ts A
gg
reg
ati
on
Unified PushNotifications
Client-SideApp Resources
Direct Update
Mobile Web Apps
Feedback Management
Device Runtime
Cross-Platform
Compatibility Layer
Encrypted and Syncable Storage
Runtime Skinning
Server Integration
Framework
Reporting for Statistics
and Diagnostics
Ap
plic
ati
on
Co
de
Ap
plic
ati
on
Co
de
HTML5, Hybrid,
and Native Coding
Optimization
Framework
Integrated Device SDKs
3rd Party Library
Integration
Worklight Studio
Worklight Console
Push /SMS
Management
Reporting and Analytics
App Version
Management
Worklight Application
Center
Development Team Provisioning
App Feedback Management
Enterprise App Provisioning and Governance
Blackberry
Android
iOS
Windows Phone
Java ME
Windows 8
SDKs
Mobile Web
Desktop Web
11 22 33
44
55
IBM Worklight components overview
IBM Software Group | WebSphere software
10
Worklight ServerWorklight Server
Authentication
JSON Translation
Server-side Java App Code -- WAS
Adapter Library
Device RuntimeDevice Runtime
Application CenterEnterprise App Store
Worklight Console
Application Code
Push Notifications
Analytics
z/Linux
z/OS
Worklight Server on System z
JSONfrom CICS
REST Requeststo CICS
IBM Software Group | WebSphere software
� Defined by Roy Fielding in 1994, documented in his year 2000 doctoral thesis
� Similar in concept to hyperlinked data
� Lightweight data transfer
� Representational State Transfer
�Nouns (URLs) indicate what is being worked on
�Verbs (GET, PUT, POST, DELETE) indicate the action to be performed (List, Create, Read, Update, Delete)
� Format of results is not defined
�Popular formats of returned data are XML and JSON
� Approaches in CICS
�Recent CICS Feature Pack creating JSON (CICS TS V4.2 and V5.1)
�Servlet and JSP engine (subset of Liberty) (CICS TS V5.1)
�Can use EXEC CICS TRANSFORM for XML parse/create
�CICS WEB API
�ATOM Feed (CICS TS V4.1+)
�Dynamic Scripting (CICS TS V4.1 and V4.2, CICS TS V5.1)
11
REST
The Representational State Transfer (REST) API
IBM Software Group | WebSphere software
12
What is REST?
•REST is an architectural style, unlike SOAP which is a protocol
•Typically use JSON to describe the data
•Uses the HTTP verbs (below) to indicate the nature of an operation
•Uses the URI to determine the resource(s) to operate upon
The basics of RESTful services
HTTP POSTHTTP POST HTTP GETHTTP GET HTTP PUTHTTP PUT HTTP DELETEHTTP DELETE
CreateCreate ReadRead UpdateUpdate DeleteDelete
http://my.cics.example/resources/
http://my.cics.example/resources/specific_resource
Example URIs A collectionA collection
IBM Software Group | WebSphere software
� Request
� Response
13
GET /mortgage/231677 HTTP/1.1Host: www.example.com Accept-Language: en Charset: UTF-8
HTTP/1.1 200 OKLanguage: en_usCharset: UTF-8Content-Type: application/json
{“principal”:”238000”,”rate”:”3.5”, “type”:”5/1 ARM”}
or
HTTP/1.1 200 OKLanguage: en_usCharset: UTF-8Content-Type: text/xml
<mortgage><principal>238000</principal><rate>3.5</rate><type>5/1 ARM</type></mortgage>
REST Simple Sample – via HTTP
IBM Software Group | WebSphere software
14
JSON is the mobile platform choice?
• The growth in mobile helped boost the popularity of JSON
• The lightweight data format is ideally suited to mobile data transfer
• As a result numerous tools and frameworks now support JSONT
JSON is the mobile format of choice
Numerous other frameworks
depend upon JSON data…
Eg. jQuery & dojo use JSON:
•JSON Store
•Ajax calls
•All data interchange
Numerous other frameworks
depend upon JSON data…
Eg. jQuery & dojo use JSON:
•JSON Store
•Ajax calls
•All data interchange
IBM Worklight uses JSON:
•For communication between a mobile
application and the Worklight Server
•Provides a JSON Store for offline storage
of data
•Automatically converts Webservice
SOAP replies into JSON
IBM Worklight uses JSON:
•For communication between a mobile
application and the Worklight Server
•Provides a JSON Store for offline storage
of data
•Automatically converts Webservice
SOAP replies into JSON
IBM Software Group | WebSphere software
15
Mobile extensions – simplified integration with mobile devicesMobile extensions – simplified integration with mobile devices
CICS TS V5.1’s advanced
scalability makes it the ideal
platform for managing
mobile workloads
CICS TS V5.1’s advanced
scalability makes it the ideal
platform for managing
mobile workloads
Scalable platformScalable platform
JSON data and RESTful
interface makes integration
with mobile devices simple
and efficient
JSON data and RESTful
interface makes integration
with mobile devices simple
and efficient
Agile integrationAgile integration
COBOL, C/C++, PL/I and
Java programs can be
RESTful service providers
COBOL, C/C++, PL/I and
Java programs can be
RESTful service providers
Service enablementService enablement
CICS Transaction Server Feature Pack for Mobile ExtensionsCICS Transaction Server Feature Pack for Mobile Extensions
Worklight® ServerWorklight® Server
COBOL, PL/I, C/C++,
and Java Services
COBOL, PL/I, C/C++,
and Java Services Direct to CICS
Via Worklight Server
Available 2Q 2013 on CICS TS V4.2 & V5.1
IBM Software Group | WebSphere software
16
Producing JSON from CICS, using the
CICS TS Server Feature Pack for Mobile
Extensions V1.0,
Scenario 1 +
16
Modeled on Web Services, top-down, existing CICS program
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+
� Overview – top down
17
HFS
JSON
schema
jsbind
CICS JSON
Assistant
WEBSERVICE
pipelineconfig
URIMAP
CICS TSTCPIPSERVICE
CPIHCWXNREST
Request
URIMAPmatching
CSOL
Pipeline
handlers
handlers
handlers
JSON
data mapping
Business
Logic
Languagestructure
PIPELINE
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+
� Expose an existing COMMAREA or channel LINKable program
�Define an AXIS2 JVMServer to do the COMMAREA or channel conversion (one time)
�Run the DFHLS2JS utility
�Define a PIPELINE, URIMAP, and WEBSERVICE to CICS
�Test
�Advantage:
� Only had to run the utility to expose CICS program, plus resource definitions (15 minutes)
�Disadvantage
� Likely does not fit the REST paradigm where a GET reads, and POST adds, etc
18
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+
� Run DFHLS2JST
19
// SET QT=''''//*//LS2WS EXEC DFHLS2JS,// TMPFILE=&QT.&SYSUID.&QT.//INPUT.SYSUT1 DD *JSON-SCHEMA-REQUEST=/u/wspotXX/cicslab/json/FundProgReqJSON.jsonJSON-SCHEMA-RESPONSE=/u/wspotXX/cicslab/json/FundProgRespJSON.jsonLANG=COBOLLOGFILE=/u/wspotXX/cicslab/logs/JSONUtilLog.logPDSLIB=//WSPOTXX.CICSLAB.UTIL4PGMINT=COMMAREAPGMNAME=FUNDPROGMAPPING-LEVEL=3.0REQMEM=FUNDCOMMRESPMEM=FUNDCOMMURI=http://zserveros.demos.ibm.com:13002/json/fundprogWSBIND=/u/wspotXX/cicslab/json/wspickup/FundProgJSON.wsbind
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+
� Define a JVMServer to do the COMMAREA or channel conversion (one time)
CSDGroup WORKSHOP
Name DDW$AXIS
JVM Profile DDWAXIS2
LE Options DFHAXRO
Threadlimit 15
20
JAVA_HOME=/usr/lpp/java/J7.0_64WORK_DIR=/u/wspotXX/cicslab/logs/JAVA_PIPELINE=YES
JVMProfile - DDWAXIS2
DDW$AXIS JVMServer definition:
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+� Define a PIPELINE to CICS – can do multiple conversions in a single pipeline
CSDGroup WORKSHOP
Name DDWAXIS2I
Configuration File /u/wspotXX/cicslab/pipelines/axis2AXIS2ProviderJSON.xml
Shelf /u/wspotXX/cicslab/shelf/
21
<?xml version="1.0"?><provider_pipeline xmlns="http://www.ibm.com/software/htp/cics/pipeline">
<service><terminal_handler>
<cics_json_handler_java><jvmserver>DDW$AXIS</jvmserver>
</cics_json_handler_java></terminal_handler>
</service><apphandler_class>com.ibm.cicsts.axis2.CICSAxis2ApplicationHandler</apphandler_class></provider_pipeline>
AXISProviderJSON.xml
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+
� Define a URIMAP to CICS
CSDGroup WORKSHOP
Host *
Name MYAXIS2I
Path json/fundprog
Pipeline MYAXIS2I
Scheme HTTP
Transaction CPIH
Usage PIPELINE
Webservice MYAXIS2I
22
Pipeline definition
Webservice definition
IBM Software Group | WebSphere software
Producing JSON from CICS: Scenario 1+
� Define a WEBSERVICE
CSDGroup WORKSHOP
Name MYAXIS2I
WSBind File /u/wspotXX/cicslab/json/wspickup/FundProgJSON.wsbind
Validation NO
WsdlFile
23
IBM Software Group | WebSphere software
� Execute it:
� The invoking entity must use a ‘post’ method, because the “old” (existing) CICS program isn’t aware of the methods and paths
� The method and the path are delivered to the CICS program, so you can write a small wrapper program that understands methods and paths
� (It is unusual for an invoking program to have to check inside a response message to see if the REST request worked OK)
24
IBM Software Group | WebSphere software
25
Producing JSON from CICS, using the
CICS TS Server Feature Pack for Mobile
Extensions V1.0,
Scenario 2 +
25
Modeled on Web Services, meet-in-the-middle, use a small wrapper program that understands paths and methods and returns status codes. It LINKs to an existing CICS program
IBM Software Group | WebSphere software
� Write a wrapper program that understands paths and methods, and returns HTTP status codes
� It invokes the existing CICS program
� Wrapper program looks at the HTTP “method” to determine the action to take, the path to see what to take the action on, and returns an appropriate status code
26
existingbusiness
logic
Wrapper
programpipeline conversion
bindingfile
existing
COMMAREA
structure
new
language
structure
CICS JSON Support
CICS JSON Assistant new lang.
structure
•COBOL
•PL/I
•C/C++
JSON
Scema
IBM Software Group | WebSphere software
� The wrapper program:
� Can look at the ‘path’ in the DFHWS-URI container
� Can test the ‘method’ in the DFHHTTPMETHOD container
� Can prepare a COMMAREA or channel and containers to invoke the target business logic program
� Can return selected fields (just what the invoking program wants)
� Can return a 404 Not Found if the data is not found, etc
27
IBM Software Group | WebSphere software
� Procedure
�Run the DFHLS2JS utility
�Define a PIPELINE, URIMAP, and WEBSERVICE to CICS
�Code the wrapper program, and test
�Advantage:
� Looks like any other REST program
� Fits the REST paradigm where the HTTP GET method reads, and POST method adds, etc
� Returns the proper HTTP response, e.g. 200, 404, etc
28
IBM Software Group | WebSphere software
Producing JSON from CICS: Meet-in-Middle, Scenario 2+
� Define a JVMServer to do the COMMAREA or channel conversion (one time)
CSDGroup WORKSHOP
Name DDW$AXIS
JVM Profile DDWAXIS2
LE Options DFHAXRO
Threadlimit 15
29
JAVA_HOME=/usr/lpp/java/J7.0_64WORK_DIR=/u/wspotXX/cicslab/logs/JAVA_PIPELINE=YES
JVMProfile - DDWAXIS2
DDW$AXIS JVMServer definition:
Same as Scenario 1
IBM Software Group | WebSphere software
� Define a PIPELINE to CICS – can do multiple conversions in a single pipeline
CSDGroup WORKSHOP
Name DDWAXIS22
Configuration File /u/wspotXX/cicslab/pipelines/axis2AXIS2ProviderJSON.xml
Shelf /u/wspotXX/cicslab/shelf/
30
<?xml version="1.0"?><provider_pipeline xmlns="http://www.ibm.com/software/htp/cics/pipeline">
<service><terminal_handler>
<cics_json_handler_java><jvmserver>DDW$AXIS</jvmserver>
</cics_json_handler_java></terminal_handler>
</service><apphandler_class>com.ibm.cicsts.axis2.CICSAxis2ApplicationHandler</apphandler_class></provider_pipeline>
AXISProviderJSON.xml
Same as Scenario 1
IBM Software Group | WebSphere software
Producing JSON from CICS: Meet-in-Middle, Scenario 2+
� Define a URIMAP to CICS
CSDGroup WORKSHOP
Host *
Name MYAXIS22
Path fundprog*
Pipeline MYAXIS22
Scheme HTTP
Transaction CPIH
Usage PIPELINE
Webservice MYAXIS22
31
Pipeline definition
Webservice definition
With wildcard, so you can have a path like fundprog/90000001
A change from previous URIMAP
IBM Software Group | WebSphere software
Producing JSON from CICS: Meet-in-Middle, Scenario 2+
� Define a WEBSERVICE
CSDGroup WORKSHOP
Name MYAXIS2I
WSBind File /u/wspotXX/cicslab/json/wspickup/FundProgJSONAlt.wsbind
Validation NO
WsdlFile
32
This wsbind file, prepared a few slides earlier invokes the wrapper program, allows for a channel interface, only provides the input/output needed
IBM Software Group | WebSphere software
� Execute a GET (read):
� With a wrapper program you can take the key from the ‘path’
� Program takes appropriate action for ‘GET’ request
� Returns a 404 status code when not found
33
GET method
Key is part of URL
Status code
IBM Software Group | WebSphere software
34
References
� SG24-8161 – Implementing CICS JSON web services for mobile applicationshttp://www.redbooks.ibm.com/abstracts/sg248161.html
� CICS V5.2 KnowledgeCenter –http://www-01.ibm.com/support/knowledgecenter/SSGMCP_5.2.0/com.ibm.cics.ts.home.doc/welcomePage/welcomePage.html?lang=en
� Roy Fielding’s Doctoral Thesis – for the definition of REST –http://en.wikipedia.org/wiki/Roy_Fieldinghttp://www.ics.uci.edu/~fielding/pubs/dissertation/top.htm
� The CICS TS Feature Pack for Mobile Extensions –http://www-01.ibm.com/software/htp/cics/mobile/
� JSON – the basics –http://www.ibm.com/developerworks/webservices/library/ws-restful/
� 5 Things to Know – Redbooks blog –
https://www.ibm.com/developerworks/community/blogs/5things/entry/5_things_to_know_about_why_system_z_is_ideal_for_mobile_apps?lang=en
IBM Software Group | WebSphere software
35
Questions+
35
IBM Software Group | WebSphere software
36
Legal Disclaimer
• © IBM Corporation 2013. All Rights Reserved.• The information contained in this publication is provided for informational purposes only. While efforts were made to verify the completeness and accuracy of the information contained
in this publication, it is provided AS IS without warranty of any kind, express or implied. In addition, this information is based on IBM’s current product plans and strategy, which are subject to change by IBM without notice. IBM shall not be responsible for any damages arising out of the use of, or otherwise related to, this publication or any other materials. Nothing contained in this publication 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 this presentation 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 this presentation 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. Nothing contained in these materials is intended to, nor shall have the effect of, stating or implying that any activities undertaken by you will result in any specific sales, revenue growth or other results.
• If the text contains performance statistics or references to benchmarks, insert the following language; otherwise delete:Performance is based on measurements and projections using standard IBM benchmarks in a controlled environment. The actual throughput or performance that any user will experience will vary depending upon many factors, including considerations such as the amount of multiprogramming in the user's job stream, the I/O configuration, the storage configuration, and the workload processed. Therefore, no assurance can be given that an individual user will achieve results similar to those stated here.
• If the text includes any customer examples, please confirm we have prior written approval from such customer and insert the following language; otherwise delete:All customer examples described are presented as illustrations of how those customers have used IBM products and the results they may have achieved. Actual environmental costs
and performance characteristics may vary by customer.• Please review text for proper trademark attribution of IBM products. At first use, each product name must be the full name and include appropriate trademark symbols (e.g., IBM
Lotus® Sametime® Unyte™). Subsequent references can drop “IBM” but should include the proper branding (e.g., Lotus Sametime Gateway, or WebSphere Application Server). Please refer to http://www.ibm.com/legal/copytrade.shtml for guidance on which trademarks require the ® or ™ symbol. Do not use abbreviations for IBM product names in yourpresentation. All product names must be used as adjectives rather than nouns. Please list all of the trademarks that you use in your presentation as follows; delete any not included in your presentation. IBM, the IBM logo, Lotus, Lotus Notes, Notes, Domino, Quickr, Sametime, WebSphere, UC2, PartnerWorld and Lotusphere are trademarks of International Business Machines Corporation in the United States, other countries, or both. Unyte is a trademark of WebDialogs, Inc., in the United States, other countries, or both.
• If you reference Adobe® in the text, please mark the first use and include the following; otherwise delete:Adobe, the Adobe logo, PostScript, and the PostScript logo are either registered trademarks or trademarks of Adobe Systems Incorporated in the United States, and/or other countries.
• If you reference Java™ in the text, please mark the first use and include the following; otherwise delete:
Java and all Java-based trademarks are trademarks of Sun Microsystems, Inc. in the United States, other countries, or both.• If you reference Microsoft® and/or Windows® in the text, please mark the first use and include the following, as applicable; otherwise delete:
Microsoft and Windows are trademarks of Microsoft Corporation in the United States, other countries, or both.• If you reference Intel® and/or any of the following Intel products in the text, please mark the first use and include those that you use as follows; otherwise delete:
Intel, Intel Centrino, Celeron, Intel Xeon, Intel SpeedStep, Itanium, and Pentium are trademarks or registered trademarks of Intel Corporation or its subsidiaries in the United States and other countries.
• If you reference UNIX® in the text, please mark the first use and include the following; otherwise delete:UNIX is a registered trademark of The Open Group in the United States and other countries.
• If you reference Linux® in your presentation, please mark the first use and include the following; otherwise delete:Linux is a registered trademark of Linus Torvalds in the United States, other countries, or both. Other company, product, or service names may be trademarks or service marks of
others.• If the text/graphics include screenshots, no actual IBM employee names may be used (even your own), if your screenshots include fictitious company names (e.g., Renovations, Zeta
Bank, Acme) please update and insert the following; otherwise delete: All references to [insert fictitious company name] refer to a fictitious company and are used for illustration purposes only.