.st0{fill:#FFFFFF;}

use LIBHTTP to talk SOAP to websites using RPGLE on IBM i 

 February 15, 2013

By  NickLitten

HTTPAPI (LIBHTTP) on IBM i is the bomb. Luckily I am not boarding a plane at the moment, so I can use that kind of language without getting strip searched by some burly TSA agents.

After spending far too long investigating various techniques to get my IBM i system to talk to an external website (Authorize.net in this case) and being led down many wrong roads… I stumbled across scott’s collection of open source RPGLE programs called HTTPAPI.

In Scott’s words:

Download HTTP API source:

This is an RPG IV service program that uses socket calls to implement the HTTP 1.1 protocol. The HTTP protocol is the data transfer protocol that is used to transfer documents over the World Wide Web.

This service program can, optionally, also do “https” (HTTP over SSL) requests to an SSL-enhanced web server.

This is a powerful utility with many uses, so I’m opening it up to the world. Since this has only been tested for a few applications with a few servers, I’m looking for people to help out with testing, documentation and maybe even with new features.

Have Fun!

In short – its a collection of programs in a library called LIBHTTP which you simply download and install on your IBM i system.

Thats it… now look at the various example programs and you will quickly see how easy it is to build a SOAP packet (containing your XML data string that you want to send to the web service) and then send it, get a response back and voila!

I spent last night playing with this, writing some RPGLE sample routines and once I had got my head around SOAP SERVER, SOAP ACTION and MERCHANT ID and MERCHANT KEY — I was quickly getting responses back from Authorize.net straight into my RPGLE programs. Simply Brilliant.

So, now its time to write a bunch of programs performing the whole Credit Card payment process for IBM i (‘AS400’ to you 1980’s luddites) written all in wonderful IBM RPG language.

*sigh* happy days….

NickLitten


IBM i Software Developer, Digital Dad, AS400 Anarchist, RPG Modernizer, Shameless Trekkie, Belligerent Nerd, Englishman Abroad 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 remember: If at first you don't succeed then skydiving probably isn't a hobby you should look into.

Nick Litten

related posts:

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}
__CONFIG_colors_palette__{"active_palette":0,"config":{"colors":{"cff50":{"name":"Main Accent","parent":-1},"a344d":{"name":"Accent Transparent","parent":"cff50"}},"gradients":[]},"palettes":[{"name":"Default","value":{"colors":{"cff50":{"val":"var(--tcb-skin-color-0)"},"a344d":{"val":"rgba(46, 138, 229, 0.85)","hsl_parent_dependency":{"h":210,"l":0.54,"s":0.78}}},"gradients":[]},"original":{"colors":{"cff50":{"val":"rgb(0, 178, 255)","hsl":{"h":198,"s":1,"l":0.5}},"a344d":{"val":"rgba(0, 178, 255, 0.85)","hsl_parent_dependency":{"h":198,"s":1,"l":0.5}}},"gradients":[]}}]}__CONFIG_colors_palette__

Get In Touch

I’m always looking for awesome input, feedback and critique!

>