Page 1
Developing a RESTful Web application for Liberty in CICS
Page 2
IntroductionCourse introduction
Page 3
Eclipse developmentenvironment
CICS region
Liberty JVM server
HTTP Call
RESTful webapplication
JCICSCOBOL programRESTful web
applicationRESTful client
What you’ll see in this course
Page 4
Development workstation
Ability to install IBM Explorer for z/OS
Access to sample code
CICS TS for z/OS V5.1 or later
What you’ll need for this course
Page 5
What you’ll learn by the end of this course
Developing a RESTful Java web service
Using the CICS Java API
Deployment of web applications
1.
2.
3.
Page 6
Creating the development environmentInstalling IBM Explorer for z/OS
Page 7
developer.ibm.com/mainframe/products/downloads
Downloading Eclipse
Page 8
Launching IBM Installation Manager
Page 9
Installing packages
Page 10
Creating the development environmentConfiguring CICS Explorer
Page 11
Configure connectivity to CICS
Configure FTP connection
Configuring connectivity
Page 12
Enabling FTP connection
Page 13
Connecting to a CICS region
Create a CMCI connection to CICS
On your CICS system
1. Add load libraries SEYUAUTH and SEYULOAD to the CICS JCL2. Create a URIMAP3. Create a TCPIPSERVICE4. Or setup CICSPlex SM WUI server
See Knowledge Center topic Setting up access for CICS Explorer
Page 14
Installed CICS Explorer
Created FTP and CMCI connections
Next section - Using CICS Explorer to manage a Liberty JVM
Summary
Page 15
Configuring a CICS Liberty JVM serverIntroduction to the Liberty JVM server
Page 16
Introduction to the Liberty JVM server
WebSphere Liberty
Java EE application server
Tightly integrated with CICS
Liberty JVM server
Basic steps of how to configure
Page 17
CICS Region
Liberty JVM server
Liberty and CICS: A 10,000 feet view
Liberty Server
JVM serverresource
.jvmprofile
server.xml
JVM
Page 18
Configuring a CICS Liberty JVM serverConfiguring a Liberty JVM server
Page 19
CICS region started
SDFJAUTH in STEPLIB
LE support added
Configuring Java in CICS
Page 20
USSHOME=/usr/lpp/cicsts/cics700
System initialization parameters
Page 21
JVMPROFILEDIR=/u/cics1
JVM profile directory
Page 22
/usr
/lpp
/cicsts
/cics700
/docs
/IBM
/JVMProfiles
/DFHJVMAX.jvmprofile
/DFHJVMST.jvmprofile
/DFHOSGI.jvmprofile
/DFHWLP.jvmprofile
USSHOME
Sample Liberty JVM profile
JVM sample profile
Page 23
${USSHOME}/JVMProfiles
/usr/lpp/cicsts/cics700/JVMProfiles
DFHWLP. jvmprofile DFHWLP. jvmprofile
${JVMPROFILEDIR}
/u/cics1
Copying the sample profile
Page 24
Reviewing and updating the JVM profile
Page 25
Reviewing and updating the JVM profile
Page 26
Enabling auto configure
Page 27
Setting the TCP/IP host values
Page 28
Selecting the JVM server resource definition
Page 29
Created JVM profile using supplied template DFHWLP.jvmprofile
Created CICS JVMSERVER resource definition
Next lecture - Install and enable the JVM server
Summary
Page 30
Configuring a CICS Liberty JVM serverStarting and validating the Liberty JVM server
Page 31
Starting the Liberty JVM server
Page 32
Verifying the Liberty JVM server is running
Page 33
Accessing the Liberty server default welcome page
Page 34
Viewing the Liberty message log
Page 35
Verifying the logs
Page 36
Verifying the logs
Page 37
Editing the server.xml file
Page 38
Adding the JAX-RS feature
Page 40
Editing the server.xml file
Page 41
Verifying the changes
Page 42
Creating a RESTful service for Liberty in CICSIntroduction to our RESTful web application
Page 43
RESTful web applications
REST
JAX-RS
Java EE 6
JSON
Page 44
CICS Region
Sample application architecture
RESTful Client
Liberty JVM Server
JAX-RS Runtime
Web Application
JAX-RSHTTP
GET request
{json}
method invoke
method return
Response Data
Page 45
Creating a RESTful service for Liberty in CICSDeveloping the application
Page 46
github.com/cicsdev/cics-java-liberty-restapp
Sample application
Page 47
New project dialog
Page 48
New dynamic web project wizard
Page 49
New dynamic web project wizard
Page 50
CICS region
Sample application architecture
RESTful client
Liberty JVM server
JAX-RS runtime
Web application
JAX-RSHTTP
GET request
{json}
method invoke
method return
Response data
Page 51
Java bean classes
CICSInformation
APPLID
JVM server
Current time
CICS environment
CICSEnvironment
Product name
Product version
Page 52
getCICSInformation method
Page 53
Importing the code
Page 54
Importing the code
Page 55
Verifying packages
Page 56
Configuring the build path
Page 57
Adding libraries to the build path
Page 58
Selecting libraries to add
Page 59
Selecting the target CICS version for deployment
Page 61
CICS Region
Sample application architecture
RESTful Client
Liberty JVM Server
JAX-RS Runtime
Web Application
JAX-RSHTTP
GET request
{json}
method invoke
method return
Response Data
Page 62
JAX-RS annotations
Page 63
JAX-RS annotations
Page 64
getCICSInformation method
Page 65
CICSInformation class
Page 66
Completed coding of our application
Ready to deploy into our Liberty JVM server
We will extend our application in the next lecture
Summary
Page 67
Creating a RESTful service for Liberty in CICSDeploying the application to the dropins directory
Page 68
Deploying via the dropins directory
Page 69
Exporting a WAR file
Page 70
Copying WAR file to z/OS
Page 71
Messages.log file
Page 72
Messages.log file
Page 73
Testing the application
http://winmvs2c.hursley.ibm.com:9080/com.ibm.cicsdev.restapp/
Page 74
The URL
http://winmvs2c.hursley.ibm.com:9080/com.ibm.cicsdev.restapp/rest/cicsinfo
Page 75
CICS Region
Sample application architecture
RESTful Client
Liberty JVM Server
JAX-RS Runtime
Web Application
JAX-RSHTTP
GET request
{json}
method invoke
method return
Response Data
Page 77
Coded
Deployed
Tested
Summary
Page 78
Creating a RESTful service for Liberty in CICSDeploying the application in a CICS bundle
Page 79
RESTful web application with dropins
Useful for rapid application development
Deploy the WAR file using a CICS bundle
First delete any existing restapp WAR files from dropins
Deploying the application in a CICS bundle
Page 80
Web Archive (WAR)
Enterprise Archive (EAR)
Enterprise Bundle Archive (EBA)
resource_1
resource_2
resource_3resource_4
resource_5
cics.xml
What is a CICS bundle?
Page 81
CICS bundle project
Page 82
CICS bundle project
Page 83
CICS bundle project
Page 84
Adding a web project to a CICS bundle
Page 85
Adding a web project to a CICS bundle
Page 86
Adding a web project to a CICS bundle
Page 87
Exporting a CICS bundle project
Page 88
Exporting a CICS bundle project
Page 89
Exporting a CICS bundle project
Page 90
Exporting a CICS bundle project
Page 91
Creating a CICS bundle definition
Page 92
Creating a CICS bundle definition
Page 93
Creating a CICS bundle definition
Page 94
Installing a CICS bundle definition
Page 95
Installing a CICS bundle definition
Page 96
Installing a CICS bundle definition
Page 97
Installing a CICS bundle definition
Page 98
Liberty messages.log file
Page 99
Testing the application
Page 100
Summary
Created sample application
Deployed into CICS Dropins directory CICS bundles
Page 101
Linking to a CICS COBOL programIntroduction to linking to a CICS program
Page 102
Introduction to linking to a CICS program
CICS concepts
JCICS Calling an existing COBOL program
EDUCHAN samplegithub.com/cicsdev/cics-java-liberty-restapp
Page 103
CICS
TASK0001 (Transaction: TRAN)
PROGRAM
PROGRAM
What is a task?
Page 104
Linking to a CICS COBOL programUsing JCICS to link to a CICS program
Page 105
CICS region
Application diagram
Liberty JVM server
Web application
JAX-RS
JCICS
HTTP request
{json}
method invoke
method return
Response data
JAX-RSruntime
COBOLprogram
RESTful client
Return
LINK
data
Page 106
Reviewing and updating the sample application
Page 107
Reviewing and updating the sample application
Page 108
Reviewing and updating the sample application
Page 109
Reviewing and updating the sample application
Page 110
Reviewing and updating the sample application
Page 111
Deploying the application
Page 112
Testing the reverse application
Page 113
Test the application
Page 114
Expose an existing COBOL program as a RESTful web application
Using JCICS to link to a CICS program
Page 115
JCICS API to access CICS tasks and programs
Passing data using channels and containers
Next section - Summary and highlights
Summary
Page 116
SummaryReview of what we have learned
Page 117
What we learned in this course
Creation of a development environment
Configuration of a Liberty JVM server
Development using JAX-RS
Use of the JCICS API
Application deployment
1.
2.
3.
4.
5.
Page 118
Download and install the sample applications
Install sample RESTful web application
Install EDUCHAN COBOL program