Web Services in native RPG straight from IBMi with RPG-XML

AS400

Nov 11

I’ve long been a follower of Mr Aaron Bartell – a nice guy and one of the most dynamic IBMi developers I have come across for a while.

He works for a company, Krengel Tech, offering some neat functions that simplify getting good old AS400 data out onto the internet. Yes, I know the AS400 was replaced by the iSeries and few years ago upgraded and replaced by the more powerful IBM i running on an IBM Power system but sometimes I just like to type the old names to (a) tweak the search engines and (b) keep the gray haired programmers happy 🙂

In simplistic terms, RPG-XML Suite essentially is an RPG service program that allows RPG programmers the ability to compose, transmit, and parse XML along with many other supporting subprocedures. These three capabilities fully equip an RPG programmer to offer (or provide) web services on the iSeries as well as call (or consume) web services on remote machines.

Calling Web Services with RPG-XML Suite

The illustration below demonstrates how an RPG program on your iSeries can “call” a web service that resides on another machine. The RPG program composes and passes an XML stream from the remote web service on the Server/Client and receives back the response XML which it parses for its data contents. For example, the RPG program could send an XML invoice to a business partner to automate the billing process, or a purchase order could be sent to a supplier to automate the shipping of widgets to your company.

Remote Web Services Calling RPG-XML Suite

The illustration above demonstrates RPG-XML Suite playing the opposite role. In this case, the Server/Client calls RPG-XML Suite by passing an XML request. The RPG Web Service running under Apache receives and parses the XML. Once the RPG Web Service program makes the data from the XML document available, other RPG business logic can be called or simply store the information to the DB2/400 database. The RPG Web Service program can then compose an XML response and return it to the caller (Server/Client).

For another example – a CRM application might reside on another machine (i.e. Salesforce.com) and is used by sales personnel to add new accounts. That application could send the newly created account information to the RPG Web Service which would write it to the appropriate DB2 database for future order fulfillment purposes.

RPG-XML Suite was built by RPG developers who have lived through creating web services in RPG and Java without a well-packaged toolset. There are a handful of alternatives that will allow RPG to connect to the outside world (like front-ending it with a Java web service), but those alternatives require the introduction of a new programming language into your environment, which can be very costly and labor intensive.

RPG-XML Suite is the right choice and proven alternative to move your iSeries into the Service Oriented Architecture arena.

You can read more on RPG-XML at:http://www.rpg-xml.com/

Follow

About the Author

IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Alpha Nerd and Passionate Eater of Cheese and Biscuits. Nick Litten Dot Com is a mixture of blog posts that can be sometimes serious, frequently playful and probably down-right pointless all in the space of a day. Enjoy your stay, feel free to comment and in the words of the most interesting man in the world: Stay thirsty my friend.