Man Resting at Beach

Rest easy with full REST web service support in RPG-XML Suite 3.2

RPG-XML Suite Version 3.2 Officially Released

Since the January 2014 introduction of the new RXS3 API and its improvements, our RPG-XML Suite customers have continued to make suggestions for even more features and new functionality. At Krengeltech we embrace these suggestions to allow developers to leverage their existing RPG skills and couple them with newer, advanced technologies.

With the introduction of version 3.2 for RPG-XML Suite we have added support for the following:

  • RESTful HTTP Methods such as PUT, DELETE, HEAD, OPTIONS and PATCH (POST and GET continue to be available)
  • Easy parsing of content from RESTful URI’s such as
  • Support for dynamic as well as compiled templates
  • Extended length templates up to 256K
  • Automatic compression of whitespace when composing from templates
  • Automatic omission of uncomposed template content
  • New function RXS_ResetDS() for easily initializing data structures used by the RXS3 API
  • Enhanced RXS_GetStmf() to allow easy reading of stream file content in “chunks” within a loop
  • Enhanced RXS_PutStdOut() for easy output of HTTP Status, Content Type and other HTTP headers
  • Extended support for very large XML stream files when using the event based parser
  • Improvements to CRTRPGTPL command

Below are some simple code examples of the enhanced features highlighted above.

Consuming a RESTful web service with the DELETE method:
gXmlResponse = RXS_Transmit( gXmlRequest : TransmitDS );

Offering a RESTful web service processing the DELETE method:gMethod = RXS_GetEnvVar( ‘REQUEST_METHOD’ );
if gMethod = ‘DELETE’;


Parsing a RESTful URI such as
gCustomer = RXS_GetUrlVar( ‘customer/’ );

Compiled templates are a hit!  Now dynamically processed templates are available as well:
ComposeDS.Stmf = ‘/www/rxs/templates/geturi2.tpl’;

Extended length templates up to 256K:
ComposeDS.LargeTemplate = RXS_YES;

Compression of whitespace when composing:
ComposeDS.TrimTemplateLines = RXS_YES;
ComposeDS.OmitLineControls = RXS_YES;

Reset or Initialize an RXS data structure:

Omit uncomposed template lines:
ComposeDS.OmitUncomposedLines = RXS_YES;

Reading a SMTF in “chunks”:
GetStmfDS.Stmf = ‘/tmp/bigfile.txt;
GetStmfDS.ChunkedLength = 65535;
dou %len(Data) = 0;
  Data = RXS_GetStmf( GetStmfDS );

Output required HTTP headers easily:
PutStdOutDS.HeaderStatusCode = 500;
PutStdOutDS.HeaderStatusText = ‘SOAP Fault’; PutStdOutDS.HeaderContentType = ‘text/xml’;
RXS_PutStdOut( gXml : PutStdOutDS ); 

Read STDIN over 16MB directly to a stream file:
GetStdInDS.Stmf = ‘/tmp/over16mb.xml’;
RXS_GetStdIn( GetStdinDS );

Output large stream files over 16MB in size to STDOUT:
gPutStdOutDS.HeaderContentType = ‘text/xml’;
gPutStdOutDS.Stmf = ‘/tmp/over16mb.xml’;
RXS_PutStdOut( *Omit : gPutStdOutDS );

Improved logging from RXS_Transmit():
# Timestamp: 2015-09-22-
# Product: RPG-XML Suite
# Version: 3.20
# JobCcsid: 37

# URI:
# RequestStmf:
# ResponseStmf:
# RequestCcsid: 1208
# ResponseCcsid: 65535
# ResponseStmfCcsid: 1208
# Timeout: 60

Interested in installing or upgrading to the newest version of RPG-XML Suite?
Contact our support team here at  

Coming next to RPG-XML Suite?  JSON composition and parsing!