i2Rest Offers Native API Alternative to IWS
August 19, 2020 Alex Woodie
IBM i shops that want to expose their RPG applications as industry standard Web services have a few options to choose from. One solution they should keep on their list is i2Rest, which is a native ILE application that exposes RPG using modern OAuth2 and OpenAPI standards.
We first came across Alexei Baranov’s work back in 2012, when he was involved in the port of the SVN client to IBM i while working at a Moscow, Russia-based consulting firm. Soon thereafter, Baranov started working on developing Web services tools for IBM i.
The first version of his new Web services technology was based on SOAP and XML and adhered to Program Call Markup Language (PCML) descriptions of RPG programs. That product, which was implemented at a large bank in the Republic of Belarus, never came to market as a shrink-wrapped product, but it did give Baranov experience in creating a high-performance native Service Oriented Application Protocol (SOAP) server on IBM i platform.
Years passed, and Baranov watched as IBM’s Integrated Web Services (IWS) product gained share in the IBM i community and became a standard way to generate Representational State Transfer (REST) and SOAP-based APIs (or Web services) from ILE programs on IBM i.
A couple of years ago, as new technology standards like OAuth2 and OpenAPI emerged, Baranov decided to revisit the world of Web services on IBM i, and to create a new version of that older product, which is still in use in Belarus today.
“We decided to improve our experience and create a lightweight and fast solution that allows RPGLE programmers to get a full-featured OpenAPI/OAuth2 server without having to dive into technologies like Java, Node.js, and so on,” Baranov tells IT Jungle via email.
The new products, called i2Rest Server and i2Rest Client, are native IBM i applications, and work like IBM’s IWS product, Baranov says. i2Rest was written in IBM ILE C and is based on the open source gSOAP toolkit.
“The server essentially does the same as the IBM IWS,” he says. “The process of upgrading existing RPGLE programs to a Web service is as simple as in IWS. It is enough to prepare PCML description of the program and publish it on the server.”
In addition to supporting PCML, the i2Rest server supports three main OAuth2 flows (authorization code, device, and client credential), which widens the number of clients that can interact with the server directly, Baranov says. When implemented, IBM i user profiles become OAuth2 resource owners and clients, and existing RPGLE programs become OpenAPIs, he says.
There are two version of i2Rest server: a free version, and a premium version. The premium version allows users to implement their own authentication and authorization procedures for users (resource owners) and clients, Baranov says. It also supports an unlimited number of APIs, API calls, and OAuth users, clients, and scopes.
The i2Rest client, which is always free, allows users to access external APIs or Web services from a 5250 green screen. It supports all major OAuth2 flows, like the i2Rest server, and can interact with various API providers, including those from Google, Facebook, Twitter, Paypal, and IBM.
There’s one feature in the i2Rest client that Baranov is particularly proud of. “An exceptional feature that we have not yet seen in other similar products is the support of Authorization code flow in green screen terminals,” he says. “This flow requires a client agent to display HTML pages in a browser. Our unique solution, Authorization Code flow using i2Rest bridge mode, allows [users] to avoid this limitation.”
Customers can get up and running with i2Rest in a short amount of time, Baranov says. “i2Rest Server and Client are completely native applications, their installation and configuration takes only few steps,” he says. Once customers prepare the PCML descriptions of their RPG programs and publish them to i2Rest, they can begin RPG programs as REST APIs.
Baranov shipped the first release of i2Rest just a couple of months ago, so it’s still fairly new. The company has one client going into production at the moment, and expects to see more as word gets out about the product. In the meantime, his company will continue to add examples of how to work with other APIs and invoke them from IBM i from his website.
Baranov is also working on an extension of i2Rest called i2Camunda, which will allow users to embed calls to IBM i programs and commands into the Camunda business process management software. For more information on i2Rest, see the company’s website at http://www.i2rest.com.