From YiPs Wiki (i powered)


(click to open)

Quick Page Table of Contents


XMLSERVICE Introduction …

Goto Main Page
Goto Documents

The following foils include running examples you can click to help get started as you learn about this Open Source.

Goal of Open Source XMLSERVICE RPG library is flexibility, enabling ANY sort of transport local/remote connection with any language available in your enterprise to call resources on your IBM i machine. XMLSERVICE primary transport interface in production today is DB2 connections using included stored procedures (xmlstoredp.srvpgm iPLUGxxxx). XMLSERVICE secondary transport interface used mostly demos is Apache REST connection (xmlcgi.pgm). However, XMLSERVICE allows writing your own custom transport (anything you imagine). XML Service and Toolkit on-going mission is to add new function, improve performance, expand uses, with goal of never impacting existing customers.

Note: Click link ‘Quick Page Table of Contents’ to navigate directly to a topic.

Warning: This is an active IBM i education machine, occasionally examples may not work, try back later.

Part 1 - Protect your investment …


XML Service - is free

XML Service - XML everything

XML Service - IBM i Native Access through XML

XML Service - Moving Parts

XML Service public “stateless” (*here)

XML Service private “state full” (*sbmjob)

XML Service Configuration

XML Service - Example HTML/XML (no PHP, no RPG)

XML Service - Example RPG (no PHP)

XML Service vs. DB2 Stored Procedures - Why use XML Service at all?

Why not write my own stored procedures?

Why use XML Service at all?

Task / Feature XML Service Stored procedure
Device, protocol, & language portability

Browser - {try it} {view it}
REST - {try it} {view it}
DB2 - {try it} {view it}
RPG - {try it} {view it}
… anything you imagine

device specific

driver specific
language specific
… hit & miss coverage

Complex Data Structures trivial {try it} {view it} near impossible
Nested/Complex Arrays Data Structures trivial {try it} {view it} near impossible
DOU Count Data Structures trivial {try it} {view it} near impossible
Call CMDs and collect data trivial {try it} {view it} very difficult
Call PASE utilities and collect data trivial {try it} {view it} very difficult
Route same job (IPC/internalKey) trivial (table examples) near impossible
30,000 records around 2 seconds fast {try it} {view it} faster
download it (click me)

Protect your investment

Part 2 - Production use today …


New PHP Toolkit included with Zend Server for IBM i

XML Interface ibm_db2, pdo_ibm, odbc included with Zend Server for IBM i

XML Service - Performance Speed Limits

Avg IBM i machine speed limits today (Oct 2012) …
  • Avg Apache serves HTML 800/hits second (non-FRCA)
  • Avg persistent DB2 driver serves 400/hits second (db2_pconnect)
  • Avg non-persistent DB2 driver serves 40/hits second (db2_connect)
Next performance improvement focus areas:

o PHP OO Toolkit overall closer to DB2 persistent connection speeds
o XMLSERVICE faster large node XML documents (large/nested structures)

XML Interface and PHP Toolkit - Active community/support

You are not alone, seek out help …

Debug technique: It’s as easy as 1–2−3–4−5–6−7–8−9 :)

  1. Run the test script that contains control “*debug” and script will “hang” while it waits on #2
    $ctl .= " *debug";
  2. A MSGW inquiry message in DSPMSG QSYSOPR will be generated by the toolkit. Note the job information (number, name, user) provided in the MSGW.
  3. STRSRVJOB using that job information as parameters.
  4. STRDBG with the program and library you wish to debug.
  5. Answer the MSGW. Any answer will do—”G” is fine.
  6. The RPG program source will appear in debug mode in your terminal, ready to step through, allowing you to inspect variables, etc.
  7. When done inspecting and stepping, let the RPG program complete (using function keys indicated on screen).
Other debug options …
           Job1 (threaded)   Job 2                        Job 3 (DB2 userid/password)    Job 4 (optional XTOOLKIT job)  
                             (ctl=*debugcgi)              (ctl=*debugproc)                (ctl=*debug)
browser -> Apache          ->XMLCGI (Apache CGI child) -> QSQSRVR (XMLSERVICE *here) 
                                                       -> QSQSRVR (XMLSERVICE client) -> XTOOLKIT (XMLSERVICE ipc=/tmp/flinstone)

$ctl .= " *debugcgi";  // Job 2 - debug XMLCGI to see REST/HTTP data passed by client (when using REST only)
$ctl .= " *debugproc"; // Job 3 - debug XMLSERVICE "client" to see DB2 passed data (DB2 interface)
$ctl .= " *debug";     // Job 4 - debug XMLSERVICE "server" to see XMLSERVICE calls (DB2 interface)
                       // Note:   when ctl='*here', both XMLSERVICE "client"/"server" 
                       //         are in QSQSRVSR job (NO XTOOLKIT job)
                       // remote: Attaching with LUW drivers changes QSQSRVR ...
                       //   CLIENT (Client Access drivers) <==> QZDAxxxx
                       //   CLIENT (DB2 Connect drivers)   <==> QRWxxxx


Tony “Ranger” Cairns - IBM i PHP / PASE

Retrieved from
Page last modified on January 21, 2015, at 05:29 PM EST