Tutorials: CICS Web Services

Includes tutorials that walk you through the process of using Enterprise Developer and Enterprise Server to generate and run several types CICS Web services.
Restriction: This topic applies to Windows environments (local development) only.

Assumptions

These tutorials are written from the perspective that all of the following is true. Specific instructions for setting up your environment to adhere to these assumptions is found in the Before you begin a CICS Web service tutorial section that follows

  • You have reviewed the Assumptions and Before you begin these tutorials sections in the Tutorials: CICS topic to ensure that your environment is set up properly.
  • You have installed the required CCSID tables.
  • You have extracted all provided demonstration files to a temporary directory on your local drive.
  • You have installed a SOAP and/or a JSON requester tool.

Before you begin a CICS Web service tutorial

Install CCSID tables
These tutorials require that you first install the IBM-37, IBM-437, and 002501B5 CCSID tables. See To install CCSID tables for instructions.
Install a SOAP and/or JSON requester tool
Each of the Tutorial: CICS Web Service Provider... tutorials require that you have either a SOAP or a JSON requester tool installed, depending on the type of provider you create. The tutorials are not specific to any particular requester tools; therefore install those of your choice.
Extract demonstration files
  1. Using Windows File Explorer or at a command prompt, extract the CICSWebServicesProjectTemplate_Eclipse.zip file, located in the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\Classic\CWS directory, to a temporary directory on your local drive.
  2. Take note of the location as you need to reference it when working through the CICS Web services tutorials.

Demonstration Project

Rather than creating new projects from scratch, Enterprise Developer provides a template project to use as a starting point for each tutorial. The template project contains most of the project components and files you need to complete all of the tutorials, although not all are used in every tutorial. The template is contained in the CICSWebServicesProjectTemplate_Eclipse.zip archive file, located in the %PUBLIC%\Documents\Micro Focus\Enterprise Developer\Samples\Mainframe\CICS\Classic\CWS directory. A few of the required files that, by design, are not contained in the .zip file are stored in the directory itself.

CICS COBOL applications
Components for each of the following CICS COBOL applications are provided in the template:
Reverse Application
The Reverse application is a CICS COBOL application that takes one or more character strings as input, reverses each of them, and sends the reversed strings as output.
InvokeReverse Application
The InvokeReverse application is generated from an existing WSDL file. With it, you invoke the Reverse application running in an enterprise server region.
ReverseJSON Application
The ReverseJSON application is a CICS COBOL application that takes a character string as input, reverses it, and sends the reversed string as output.
InvokeReverseJSON Application
The InvokeReverseJSON application is generated from an existing JSON file. With it, you invoke the Reverse application running in an enterprise server region.
LoanDemo and LoanDemoJSON Applications
LoanDemo consist of a CICS application, LOANPAYM, that simply accepts a Principal amount, a Loan Term amount, and a Rate amount. These three input values are required to calculate and return a Monthly Payment amount.
filmsREST Application
The filmsREST application is a CICS COBOL application that stores and retrieves film records, which include the title, year released, director, and media format for each film.
Project files
The CWSProject includes the following files:
.cobolBuild, .cobolProj, and .project
Eclipse template files used to create each tutorial project.
RESTLogic.cpy
A copybook that contains the logic required to create a RESTful Web service provider.
LOANPAYM.cbl
A CICS COBOL program used to create a CICS Web service provider using the bottom-up method.
LOANINP.cpy
A copybook that contains the input structure for the LOANPAYM program.
LOANOUT.cpy
A copybook that contains the output structure for the LOANPAYM program.
revLogic.cpy
For WSDL tutorials, a copybook that contains the business logic for the generated Web service.
revLogicJ.cpy
For JSON tutorials, a copybook that contains the business logic for the generated JSON Web service.
RESTLogic.cpy
Contains procedure-division logic for the filmsREST application.
CICSWebServicesTemplate.xml
An Enterprise Server template used to create an enterprise server region on which to run CICS Web services.
films.json
A JavaScript Object Notation (JSON) file that describes a RESTful CICS Web service.
reverse.json
A JavaScript Object Notation file that describes both the input and the output structures for a CICS Web Service.
loadlib
As you work through the tutorials, you create this folder to contain files generated by Enterprise Developer. Initially, it does not appear listed on the project.
dfhdrdat
A resource definition file that defines the resources required to run the Web service on Enterprise Server.
reverse.wsdl
A Web Service Description Language (WSDL) file that describes a CICS Web service.
basicsoap11provider.xml
A basic SOAP configuration file used for the provider pipeline.
basicsoap11requester.xml
A basic SOAP configuration file used for the requester pipeline.
JSONConfig.xml
A basic JSON configuration file used for the provider pipeline.

Project configuration

The template project is configured to use the following settings. All other settings remain set to their respective defaults:

Output path
This is set to write generated files to the loadlib project folder.
Build path
Includes the cpy project subfolder, ensuring that the compiler finds all included copybooks.
Preprocessor
Set to build the project using the CICS preprocessor.
Character set
Set to use the ASCII character set.
Dialect
Set to use the Micro Focus COBOL dialect.
Mode
Sets the mode to word-storage by setting the IBMCOMP compiler directive.

Sequence

Each Tutorial: CICS Web Service Requester... tutorial requires that you complete its corresponding Provider... tutorial as a prerequisite. Details are provided as part of the tutorial itself. Otherwise, you may complete these tutorials in any order. They are not interdependent.