Before you start
This tutorial shows how you can use CICS SupportPac CA1S to quickly expose CICS COMMAREA programs on the Web with PHP—a simple and powerful language that is ideally suited to rapid Web development. You will create a Web service that uses REST and JavaScript Object Notation (JSON), ensuring that it can easily be consumed by a variety of clients, such as Asynchronous JavaScript and XML (Ajax) front ends, other Web services, and mash-ups.
The example CICS COMMAREA program provided with this tutorial (see Download) is a simple library application written in COBOL. It holds a list of books in a VSAM file to which entries can be added or removed, and allows books to be marked as borrowed or returned.
In this tutorial you will:
- Set up the library program on your CICS system.
- Learn how to invoke CICS COMMAREA programs from PHP.
- Learn about the features in CA1S that simplify the creation of RESTful Web services.
- Expose the library program as a RESTful Web service
To get the most out of this tutorial, you should have a basic understanding of the PHP language and some familiarity with CICS administration or CICS program development. To read up on CICS, visit the CICS TS 3.2 Information Center. You may also want to read through the introduction section of the CA1S user guide, which briefly outlines the purpose of CA1S and the principles of REST. (See Resources for links to these guides and documentation.)
To compete the tutorial, you will need a CICS environment that meets the prerequisites listed on the CA1S download page.
Download and install the CA1S SupportPac following the instructions in the CA1S user guide. Verify your installation by invoking the HelloCICS.php script as described in the guide.
- Any text editor is sufficient to write PHP scripts. You can use an IDE such as Eclipse PDT.
- You will need a mechanism to transfer PHP scripts from your workstation to your CICS server, such as an FTP client or the Target Management plug-in for Eclipse.
- To test your RESTful Web services, you will need a simple REST client
that can issue
GET,POST,PUT, andDELETEHTTP requests, such as the Poster add-on for Mozilla Firefox.
Downloads for all tools described can be found in Resources.



