CICS use of mobile technologies
This chapter describes the existing and new aspects of Customer Information Control System Transaction Server (CICS TS) that enable you to move your CICS applications, and business, into the mobile space. The chapter includes the following topics:
2.1 REST
Representational State Transfer (REST) is a defined set of architectural principles by which you can design web services that focus on service resources. The REST architectural pattern takes advantage of the technologies and protocols of the World Wide Web to describe how data objects can be defined and modified.
In contrast to a request-response model such as SOAP, which focuses on procedures made available by the system, REST is modeled around the resources in the system. Each resource is globally identifiable through its Uniform Resource Identifier (URI). Because REST does not focus on the procedures and services provided by a system, a small number of actions are defined based on the existing Hypertext Transfer Protocol (HTTP) methods: GET, POST, PUT, DELETE, HEAD. The methods are used as shown in the following list:
GET Retrieve a resource representation.
PUT Modify a resource representation.
POST Create a new resource representation.
DELETE Delete a resource representation.
HEAD Retrieve a resource’s metadata.
It is important to notice that REST does not carry any information regarding a service in the HTTP Body of a request.
2.2 JSON
JavaScript Object Notation (JSON) is an open standard format for data interchange. Although originally used in the JavaScript scripting language JSON is now language-independent, with many parsers available in many languages.
Compared to Extensible Markup Language (XML), JSON has many advantages. Most predominantly, JSON is more suited to data interchange. XML is an extremely verbose language: Every element in the tree has a name, and the element must be enclosed in a matching pair of tags.
Alternatively, JSON expresses trees in a nested array format similar to JavaScript. This enables the same data to be transferred in a far smaller data package with JSON than with XML. This lightweight data package lends itself to better performance when parsing.
JSON supports two structures: Objects and arrays. Objects are an unordered collection of name-value pairs, where arrays are ordered sequences of values. JSON also supports four simple types: Strings, numbers, Boolean expressions, and null values. This enables JSON to describe any resource. JSON can be seen as both human and machine-readable. JSON is an easy language for humans to read, and for machines to parse.
2.3 Existing support in CICS for mobile
CICS has been providing web services capabilities since CICS TS V3. The first capability introduced was SOAP web services in CICS TS V3.1. Atom support followed in CICS V4.1.
2.3.1 Atom
The Atom Syndication Format and the Atom Publishing Protocol are two standards that together make the Atom standard. CICS can provide Atom feeds using data provided by CICS resources. Atom feeds supply web clients with a series of data items containing metadata for each item in the Atom Syndication Format. With CICS V4.1, your CICS applications can be enabled to provide live information for Web 2.0 consumption. HTTP requests can also be used to edit CICS resources following the Atom Publishing Protocol.
Atom enables you to access your CICS resources in a REST-conforming (RESTful) way using XML without a heavyweight process.
For information about Atom feeds from CICS, see the following website:
2.3.2 SOAP web services
SOAP is a simple XML-based protocol for applications to exchange information over Application Layer protocols such as HTTP. SOAP can be used to create request-response interactions. SOAP is a lightweight protocol which is platform, operation system, and transport-independent.
SOAP web services support was introduced in CICS TS V3.1
This XML-based protocol consists of the following three parts:
An envelope, which defines what is in the message and how to process it
A set of encoding rules for expressing instances of application-defined data types
A convention for representing procedure calls and responses
The most common method of exchanging SOAP messages uses HTTP. However, SOAP can be used with a variety of transport protocols, such as Java Message Service (JMS), Simple Mail Transfer Protocol (SMTP), or File Transfer Protocol (FTP).
2.4 New mobile support in CICS
CICS TS for IBM z/OS Feature Pack for Mobile Extensions V1.0 introduced new capabilities to CICS web services.
2.4.1 JSON with feature pack
Support has now been introduced, through the feature pack, to enable CICS to accept and receive HTTP web service requests using the JSON data format when calling your CICS applications using CICS web services. CICS can be configured so that your existing CICS applications can take advantage of this without any need for the application to be updated. This configuration can be driven from either a JSON schema, where CICS will generate your high-level data structure format, or from the structure to a JSON schema.
Using this feature, CICS will process an HTTP payload in JSON data format, and convert the data into the high-level language structure of a target CICS application, whether that application is in Common Business Oriented Language (COBOL), PL/I, C, or C++. The data will then be passed to the CICS application in either Channels and Containers or the communication area (COMMAREA).
When the application exits and control is returned, CICS will convert the output of the CICS application (in its high-level language structure) back to the JSON data type. This response is then sent back to the service requester through an HTTP payload.
The JSON to high-level language structure conversion service, and the high-level language structure to JSON conversion service, are also available through a LINKable program. CICS applications can use this LINKable program to call any external service expecting data in the JSON format. This enables your business applications to focus on business logic, and enables CICS to handle the burden of the data transformation.
When configured from a JSON schema, CICS can also be used to call your CICS applications in a RESTful architectural style. You are able to configure your JSON web services to call a number of different CICS programs based on the HTTP method used to make the call. The CICS programs then also receive further information, such as the query string that was used to make the RESTful request. This information can then be used in the logic of your CICS applications.
Liberty JSON/JAX-RS feature
IBM WebSphere Application Server Liberty profile (Liberty profile) is a dynamic profile that enables the server to provision only the features required by the applications deployed to the server. With CICS TS V5.1, a Liberty profile can run within a CICS Java virtual machine (JVM) server.
When using the Liberty profile in a CICS JVM server, you can configure the profile to enable the jaxrs-1.1. After enabling jaxrs-1.1, the feature provides support of the Java application programming interface (API) for RESTful web services (JAX-RS). JAX-RS is used for designing web services for the REST design pattern, using annotations to simplify the development and deployment of Java-based web service clients and endpoints.
Although further details of using the Liberty profile with JAX-RS enabled will not be covered in this book, information about the rapid implementation of an application that uses it can be found in the following IBM developerWorks® article:
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset