Writing RESTful web services using CICS Liberty Server - Part 1
DanielFitzgerald 270006EMDR Comment (1) Visits (1912)
Writing RESTful Web Services using the CICS Liberty server - Part 1
My name is Daniel Fitzgerald, I'm a trainee software developer in the CICS team based at IBM Hursley UK. I've been working for the last six months on the Mobile Extensions Feature Pack V1.0 for CICS Transaction Server. As part of the project we looked at using JAX-RS, JSON and RESTful designs within Liberty. This article, coming in two parts is the result of these investigations.
The CICS Liberty server is a web container technology based on WebSphere Application Server Liberty Profile. It comes as part of CICS TS V5.1 at no extra cost and offers the potential for significant zAAP offload compared to a regular CICS Web Service. The CICS Liberty server offers a lightweight Java container with all the features of Java Servlets and JavaServer Pages (JSP's) as well as local access to your existing CICS applications and data. You can expose these existing resources to the web using Java Servlets hosted in the CICS Liberty server and design them in a RESTful way. But before we begin what exactly is REST?
The term 'REST' refers to Representational State Transfer, a design pattern for interacting with resources stored in a server. Each resource has an identity, a data type, and supports a set of actions. The RESTful design pattern is usually used in combination with HTTP, the language of the internet. In this context the resource's identity is its URI, the data type is its Media Type, and the actions are made up of the standard HTTP methods GET, PUT, POST and DELETE.
REST vs SOAP
Now we understand what REST is, why would we want to use it? Why not use Simple Object Access Protocol (SOAP)?
Whilst you decide if a RESTful architecture is for you, let's consider some business cases:
A quick note on exactly what JAX-RS is. It stands for Java API for RESTful web services and is used for designing web services according to the Representational State Transfer (REST) design pattern. It uses annotations to convert between Java and web data. There are many implementations of JAX-RS in use today including the CICS Liberty Server, WebSphere Application Server and Apache Wink.
In the next part of the article I'll discuss the actual implementation of such a service including packaging and deployment to the CICS Liberty server complete with screenshots and code samples.