Skip to main content

By clicking Submit, you agree to the developerWorks terms of use.

The first time you sign into developerWorks, a profile is created for you. Select information in your profile (name, country/region, and company) is displayed to the public and will accompany any content you post. You may update your IBM account at any time.

All information submitted is secure.

  • Close [x]

The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerworks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

By clicking Submit, you agree to the developerWorks terms of use.

All information submitted is secure.

  • Close [x]

developerWorks Community:

  • Close [x]

Build a RESTful service on CICS with PHP

Robin Fernandes (robin_fernandes@uk.ibm.com), Software Developer, IBM
Photo of Robin Fernandes
Robin Fernandes joined IBM's Java Technology Centre in Hursley, United Kingdom as Software Developer after graduating from Imperial College in 2003. His current focus is a Java-based runtime for PHP, which is used in the CA1S SupportPac and WebSphere sMash. He also regularly contributes test cases and patches to php.net and enjoys experimenting with audio software in his spare time.
Jonathan Lawrence (jlawrence@uk.ibm.com), Software Developer, IBM
Photo of Jonathan Lawrence
Jonathan Lawrence joined IBM's Java Technology Centre in Hursley, United Kingdom as a Software Developer in 2006, after 4 years in Hursley's Software Services department where he was a CICS and Cross-platform Integration Specialist. He designed the CICS integration aspects of the CA1S SupportPac.

Summary:  CICS® Transaction Server® (TS) is a powerful transaction manager designed for rapid, high-volume processing. SupportPac CA1S uses technology from IBM WebSphere® sMash to enhance CICS TS with PHP scripting capabilities and Representational state transfer (REST)-related features. This tutorial shows how you can use PHP to quickly and easily work with CICS programs and expose them on the Web. If you are a PHP developer, find out how you can use your skills to interact with enterprise assets in CICS; if you are a CICS developer, see how PHP provides a simple and agile way to manipulate your existing resources.

Date:  21 Apr 2009
Level:  Intermediate PDF:  A4 and Letter (409 KB | 37 pages)Get Adobe® Reader®

Activity:  12723 views
Comments:  

Summary and next steps

In this tutorial, you have learned:

  • How to generate Java classes representing the CICS COMMAREAs and make them available to CA1S.
  • How to prepare input data for a CICS COMMAREA program, invoke the program, and read its output data using PHP code.
  • How to use PHP reflection to explore the fields available on a COMMAREA object.
  • How to use WebSphere sMash-style event handlers and zget() to quickly write PHP code that responds to REST requests.
  • How to encode and decode JSON data from PHP.
  • How to use the knowledge to expose a CICS program as a RESTful Web service.

Next, you could explore the features of CA1S that were not covered by this tutorial, such as:

  • Accessing DB2 databases with the PDO extension
  • Managing units of work and transactionality from PHP code using the Commit/Rollback API
  • Debugging PHP scripts with PDT

For more information, see the CA1S documentation.

6 of 9 | Previous | Next

Comments



static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=Web development, Open source
ArticleID=383593
TutorialTitle=Build a RESTful service on CICS with PHP
publish-date=04212009
author1-email=robin_fernandes@uk.ibm.com
author1-email-cc=
author2-email=jlawrence@uk.ibm.com
author2-email-cc=