REST Services For IBM i In developerWorks Spotlight
February 4, 2015 Alex Woodie
One of the exciting new features added to IBM i in late 2014 is support for REST-based Web services. The rest of the world has accepted REST services as the de-facto integration standard on the Web, and now this approach is being supported within IBM i too. But how do you actually go about building and managing REST services in IBM i? Let the smart IBMers at developerWorks show you how.
REST services are very new to IBM i, having been announced by IBM just four months ago and delivered in late December 2014 with the various HTTP Group PTFs that included the REST capabilities in the latest round of Technology Refreshers, specifically IBM i 7.1 TR9 and IBM i 7.2 TR1.
In “Building a REST service with integrated web services server for IBM i: Part 1,” IBM software engineer Nadir Amra provides a technical overview of REST services through the IBM i lens.
Amra starts out by providing some context. For several years, IBM i has supported an alternative Web services protocol called SOAP (Simple Object Access Protocol). Developers have been able to use IBM i’s integrated Web services capabilities to expose ILE programs and service programs via the SOAP protocol. While SOAP is still widespread and is popular with first-gen service oriented architecture (SOA) approaches, the pure HTTP approach represented by REST has exceeded the popularity of SOAP. It’s clear that REST is the leader when it comes to Web services technologies.
The good news for IBM i developers who want to start using the new REST (Representational State Transfer) method is that many of the same techniques they learned with SOAP still apply. “The unmatched simplicity of exposing assets (for example, data or services) as SOAP-based Web services has now been extended to REST-based Web services,” Amra writes.
In part 1 of his series, Amra familiarizes developers with basic REST concepts, such as URIs versus URLs, root resources, resource methods, and the input and output parameters for resource methods. He also covers how the integrated Web services server in IBM i supports REST services, and how the different data types (JSON and XML) are represented.
In “Building a REST service with integrated web services server for IBM i: Part 2”, Amra leads the reader through the development and deployment of a simple RESTful application based on RPG. Readers are expected to be familiar with the IBM Web Administration for i GUI, which provides access to the Create Web Services Server wizard.
Both part 1 and part 2 were published just last week, so they are still fresh, Amra plans one more piece to this series, which will focus on building more complex REST services using ILE assets. We’ll keep an eye out for this piece when it’s done.
The World Wide Web has evolved tremendously over the past 20 years, and the pace of development can be daunting. But, as Amra writes, the technological advances also present new opportunities for the crafty IBM i developer to exploit.
“Developing REST APIs is a great way of promoting data sharing and reuse, but more importantly, it enables enterprises to engage customers in new markets,” he writes. “By allowing external developers to access your data through REST, you make it easy for them to build cool new applications and come up with interesting ways to piggyback on your product or data. So unleash your assets!”