SUPERSIMP – just return a success code and message
Here is an example of a super simple IBM i Webservice program.
It's written in ILE RPG (RPGLE), it's very easy to follow, even if you don't understand RPG language.
This program will be controlled by the integrated webserver that comes with IBM i -- so now extra software is needed to be installed!
Let's look at the RPGLE in more detail:
SUPERSIMP – core RPGLE
**free
//
// Very simple example of a webservice.
//
// This will start and just return a success message
//
// To Compile:
// CRTBNDRPG PGM(yourlib/SUPERSIMP)
// SRCFILE(yourlib/QRPGLESRC) SRCMBR(SUPERSIMP)
ctl-opt
dftactgrp(*no)
actgrp('NICKLITTEN')
pgminfo(*pcml:*module)
copyright('Version 1.0 Serve This')
option(*nodebugio:*srcstmt:*nounref)
;
dcl-pi *n;
rtnSuccess ind options(*nopass);
rtnMessage char(256) options(*nopass);
end-pi;
rtnSuccess = *on;
rtnMessage = 'Webservice (SUPERSIMP) completed normally';
return;
//
// Very simple example of a webservice.
//
// This will start and just return a success message
//
// To Compile:
// CRTBNDRPG PGM(yourlib/SUPERSIMP)
// SRCFILE(yourlib/QRPGLESRC) SRCMBR(SUPERSIMP)
ctl-opt
dftactgrp(*no)
actgrp('NICKLITTEN')
pgminfo(*pcml:*module)
copyright('Version 1.0 Serve This')
option(*nodebugio:*srcstmt:*nounref)
;
dcl-pi *n;
rtnSuccess ind options(*nopass);
rtnMessage char(256) options(*nopass);
end-pi;
rtnSuccess = *on;
rtnMessage = 'Webservice (SUPERSIMP) completed normally';
return;
Let's have some fun with creating this super simple RPG program, adding it to the IBM Webserver and getting our Power System talking to the outside world.
Strap in!!