Blogs

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

  • Posted on: 18 December 2013
  • By: NickLitten

Thankyou -- Scott Klement!

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.

Firstly, I have never met Mr. Klement but (like almost every IBM i Developer out there) have read many of his excellent articles about programming and tinkering with IBM i systems. Secondly, the man is a genius and I owe him a very large beer. 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.

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

  • Posted on: 18 December 2013
  • By: NickLitten
as400 to web is clever stuff
 

Thankyou -- Scott Klement!

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.

If you have never met Mr. Klement you have probably read many of his excellent articles about programming and tinkering with IBM i systems. Scott is a terrific programmer and I owe him several very large beers. 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! 

What happened to the Forums?

  • Posted on: 17 December 2013
  • By: NickLitten

Hello websurfing chaps and chappettes,

Over the years this website has been through many, many changes – from HTML to Flash to Joomla to Wordpress and finally to Drupal. A couple of years ago, I decided to import lots of my old programming and AS400 specific documentation into the website and imported everything in Drupal ‘forums’. Primarily as an easy place to reference old technical articles and because I thought some of the older ‘RPG Programming’ questions just might help the IBM I community out there. Apart from my burbling blogs, the forums are easily the most accessed part of the website.

However, I now find myself spending (wasting) time every day deleting spam, moderating people leaving nasty comments and just basically being annoyed by the inability of some people to have sensible conversations using online forums.

So – whats the solution?

Social media is the answer. Over the last couple of years I've increasingly chosen to use Facebook and Twitter to communicate. I’ve also integrated DISQUS into every article on the website, as it has superb antispam tools built into it. Effectively the entire website is now acting like a forum with facebook and twitter being the new places for chatter and banter.

So, if you’re looking for a Forum – STOP LOOKING. They are dead. Gone. Deceased.

Alas Poor Boris... aka... DEATH of a Landrover

  • Posted on: 12 December 2013
  • By: NickLitten
love to hate this landrover lr3

Boris the Landrover has broken down one final time.

This mornings refusal to start (again!!!) was the final straw!

 

NOTE ADDED MAY 2014: A few people have asked me how I get him to start each time. It's simple, but very annoying, embarrassing and just plain irritating. Simply pop the bonnet (American translation "open the hood") remove the first spark plug connection, return the car and turn it over... it will normally start... leave it to run for 10 seconds or so.... carefully reconnect the spark plug without getting a zap on your fingers and you're off...  now back to the story of why I killed Boris..

So, after doing the sums and realizing that I've spent nearly fourteen thousand dollars on repair bills since owning this Landrover in just two years, and he's still going wrong on a regular basis, its time to give up.  To resign myself to the sad decision to banish Boris to a life in the wilderness, outside the walls of castle Litten. I havent got the heart to sell the car to another owner, or even to trade it into a dealer and be able to look someone in the eye while saying "Yes, this is a reliable little motor and I will be sad to see it go" so its time for the car auctions.... Everybody knows that its a case of 'buyer beware' at Auctions. You can get a steaming deal or a steaming Turd. I know which category I wold put Boris into  :)

Talking to Authorize.net using XML, RPG from IBM i

  • Posted on: 30 November 2013
  • By: NickLitten


So, for the last few weeks I've been working on adding credit card handling to a legacy RPG application with an static HTML website over the top. The application code itself was written in the eighties and has evolved through a number of different versions of RPG (a mix of RPG2, RPG3, RPG400 and even a liberal splash of RPGLE) so I've had an enjoyable task of taking a bunch of old code, re-factoring to RPGLE/free and then adding some funky web services.

Now I've added the Authorize.net CIM functions and windows to my website pages, I can manually test the payment process. Now, the authorize.net documentation is not for noobs and makes an awful lots of assumptions, so implementing this technique on IBM i (AS400) using RPG, without a modern PHP Server on the front, is not as clear as it seems. After reading everything I could on the various SOAP, XML, JAVA, RUBY techniques - I've opted for the XML route.

The next step is setting up the XML conversation to this lovely IBM i System talk to Authorize.net. After two days of googling, reading, studying, prototyping, re-prototyping, going down dead ends, trying sample code that doesn't work and repeating moaning and smacking my forehead with a wooden paddle.

So I want to

Shall we Disqus why Drupal Comments are Dead?

  • Posted on: 14 November 2013
  • By: NickLitten

Spammers... I bloody hate them.

Over the last few weeks, I've had a rash of spam attacks. The modules I was using to modulate spam (Mollom, Antispam, Botcha) worked very well in blocking the huge portion of it. The downside was a big upsurge in CPU utilization on my webserver and finally getting a 'cease and desist' warning from the website abuse folks over at ICDSOFT. *sigh*

So, rather than continue to fight the evil Spam OverLords I decide to travel a different route and let someone fight the battle for me. Why handle the website comments myself when I can let an third party handle them for me.... after a little investigation I was left thinking "Facebook comments or something else to handle it?"

Facebook integration is cumbersome and my memories of doing it last time were not something I want to play with again. There is not enough hours in the day.

DISQUS is very cool.

Enough Said.

Integration of DISQUS in a Druapl7 install is simple. Grab the module from here and plop it into Drupal, then create an APP over on disqus.com for your website and add the APP Keys into your Drupal and VOILA fully managed commenting service. 

Instruction from Disqus are easy to walk through:

 

Latest version of RPG is RPG7.1 right?

  • Posted on: 13 November 2013
  • By: NickLitten

 RPG is not a Rocket Propelled Grenade

RPG2 is that Logic Cycle Thing

RPG3 is the System/38 version

RPG400 is the revamped RPG3 that came with AS400

​everything after that is RPG... unless its ILE then its RPGLE or sometimes RPG4, or its free format so its RPGLE /Free... or its SQL so its RPGSQL or SQLRPGLE... or as many people call RPG/Free - RPG FIVE..... aaaargh

Why doesn't IBM just have a simple version number for each iteration of the wonderful IBM RPG programming language?


IBM i 7.1 Technology Release 7



I love the enhancements to RPG with IBM i V7.1.7. RPG finally looks and reads like a normal modern language. With the advent of this latest version of IBM i, RPG has been neatly upgraded to be a fully free format language. This is a long overdue and a significant change to the language itself. 


Latest version of RPG is RPG7.1 right?

  • Posted on: 13 November 2013
  • By: NickLitten

 

RPG is not a Rocket Propelled Grenade

RPG2 is that Logic Cycle Thing

RPG3 is the System/38 version

RPG400 is the revamped RPG3 that came with AS400

​everything after that is RPG... unless its ILE then its RPGLE or sometimes RPG4, or its free format so its RPGLE /Free... or its SQL so its RPGSQL or SQLRPGLE... or as many people call RPG/Free - RPG FIVE..... aaaargh

Why doesn't IBM just have a simple version number for each iteration of the wonderful IBM RPG programming language?

IBM i 7.1 Technology Release 7

I love the enhancements to RPG with IBM i V7.1.7. RPG finally looks and reads like a normal modern language. With the advent of this latest version of IBM i, RPG has been neatly upgraded to be a fully free format language. This is a long overdue and a significant change to the language itself. 

RPG gets a facelift with IBM i 7.1 TR7

  • Posted on: 13 November 2013
  • By: NickLitten

I'm loving the new changes to RPGLE with IBM i 7.1 TR7 (that is Technology Release 7). Not to be confused with the awesome Triumph TR7, the sexy pop-up headlight car from the eighties, but I digress...

  • Removal of many unnecessary specifications like F, or P
  • /free /endfree is gone
  • the long procedure and variable names are gone and replaced by dcl-pr instead

Looking at RPG code in the editor, and it actually looks like a modern language *shock*

RPG upgrade with ibmi 71

IBM, quite predictably, is pushing the use of Rational Developer for i (RDi) as all the new coding functions are not available from SEU, PDM or SDA etc. Green screen is dying, get with the program. RDi (Rational Developer for IBM i) is supposedly solid and has been rewritten from the ground up to be smooth and error free. IMHO - it needs to be to be an explosive success. Can you hear me IBM?

Rational Developer for i V9: RPG & Cobol Tools + Modernization Tools + Java Tools

SQL RPG and the annoying compile COMMIT *NONE thing

  • Posted on: 12 November 2013
  • By: NickLitten

SQL has been a major game changer in the RPG programming world.

I first played with SQL back the golden days of RPG3 and RPG400 when we were all wrapped up in using Commitment Control. Journalling files and making changes to data in our RPGSQL programs before issuing a COMMIT or ROLLBACK was exciting and new. Roll forward a few years and database access times have massively increased and the entire concept of commitment control is not something we focus on so much in the RPG programming world.

Because of this history, in modern RPG4 SQL programs, we still have to tell the program not to use commitment if we don't want to use it. This also means you can use embedded SQL in RPG4 programs without journaling your files.

COMPILE TIME PARAMETER

The easiest way is to enter the create parameter of COMMIT(*NONE) thing so it turns it off after the first commit without the isolation level nonsense.

CRT RPG SQL

Pages