XMLSERVICE
XMLSERVICE lets code written in another language call RPG, COBOL and CL programs on IBM i and read the answer back as XML. It is open source RPG that IBM ships in the QXMLSERV library and maintains on GitHub, and it is the engine inside the Python, Node.js and PHP itoolkit packages, which is how AI glue code reaches business rules that live in programs rather than in Db2 for i tables.
What is XMLSERVICE?
Think of it as an order window on the side of IBM i. Your code slides a note through the window written as XML, which stands for Extensible Markup Language, a plain text way to label data. XMLSERVICE reads the note, runs what you asked for on the machine, and slides the answer back as XML. The useful part is what the window is made of. IBM's documentation says XMLSERVICE is 100 percent RPG and never requires Java, PHP or any other front end language. The piece doing the work speaks the same language as the programs it is calling.
You probably already have it. IBM ships the objects in a library named QXMLSERV, delivered with the PTFs for the Apache based HTTP server. PTF stands for Program Temporary Fix, which is IBM's name for a patch. Seiden Group, which maintains the PHP Toolkit, says it plainly: you will find XMLSERVICE in the QXMLSERV library on your IBM i. You can also build it from source into a library named XMLSERVICE, which needs the ILE RPG compiler, 5770-WDS option 31, plus Python 3 and GNU make.
What can it run?
- Programs and service programs. This is the main job. A script in another language runs an existing RPG or COBOL routine and gets its output parameters back.
- CL commands. CL stands for Control Language, the command language built into IBM i.
- Shell commands in PASE for i, the AIX runtime that sits inside the operating system.
- SQL statements against Db2 for i. SQL stands for Structured Query Language.
- System APIs, such as the data queue programs QSNDDTAQ and QRCVDTAQ.
XMLSERVICE can also hold a job open between calls. IBM's own FAQ gives the reason in plain words: most RPG programs do something other than hello world, with several files open and a lot of state you do not want to restart each time called. A fresh job per call still works, but IBM says it is slower, because XMLSERVICE has to start from scratch every time.
How does the call reach IBM i?
The three transports named in IBM's own Python toolkit
| Transport | How it connects | Works from |
|---|---|---|
| iLibCall | A direct call inside the same job | The IBM i itself only |
| iDB2Call | Over an existing Db2 connection | The IBM i itself or another machine |
| iRestCall | Over plain HTTP, through the XMLCGI program | The IBM i itself or another machine |
Transport names and descriptions come from the README inside IBM's python-itoolkit repository. The Node.js toolkit adds an SSH transport, which its own README shows in the first example. XMLSERVICE itself offers two front doors: the XMLCGI program for HTTP, and the XMLSTOREDP service program for Db2 stored procedure calls. Table rows are not linked because this site's content blocks render as plain text.
How much data fits in one call?
The iPLUG stored procedures, by the most XML each one carries per call
| Procedure | Most data per call |
|---|---|
| iPLUG4K | 4,064 bytes |
| iPLUG32K | 32,000 bytes |
| iPLUG65K | 65,536 bytes |
| iPLUG512K | 512,000 bytes |
| iPLUG1M | 1,000,000 bytes |
| iPLUG5M | 5,000,000 bytes |
| iPLUG10M | 10,000,000 bytes |
| iPLUG15M | 15,000,000 bytes |
Sizes come from the XMLSERVICE documentation, which explains the choice this way: pick a size so you do not transport a whole bunch of blanks between your scripting and IBM i applications. Result set versions, named iPLUGR plus the same size, exist for database connections that cannot handle input and output parameters.
Why does AI work on IBM i need this?
Most AI work on IBM i is glue code. Something has to fetch the facts, hand them to a model, and bring the answer back. The newer tools fetch with SQL. Mapepire moves Db2 for i rows over Secure WebSockets, and IBM's IBM i MCP Server turns SQL into tools an AI agent can pick up. That covers tables. It does not cover the rule that lives inside an RPG program written decades ago and never written down anywhere else. There are two ways to reach that rule. One is to wrap the program in a Db2 external stored procedure, using CREATE PROCEDURE with EXTERNAL NAME and LANGUAGE RPGLE, so SQL can call it. The other is XMLSERVICE, which was built for program calls from the start.
Two things to watch. XMLSERVICE will hang right out of the box when the system CCSID is 65535, which means no character set is tagged; CCSID stands for Coded Character Set Identifier, and IBM's FAQ says to set a real value such as 37 in the configuration instead. Version numbers are also soft here. The GitHub repository carries no real release tag, only a test tag from February 15, 2022, so the 2.0.2-dev label people quote comes from the documentation build rather than a shipped release. On the client side, the Python toolkit's last release on PyPI was February 3, 2023, while the Node.js toolkit was published on September 29, 2026.
Related Terms
Python for IBM i
Python for IBM i is the open source Python runtime IBM delivers as yum installable RPM packages that run inside PASE for i, under /QOpenSys/pkgs. It is the practical place to run AI client code on the box itself, because the pieces that job needs are already Python packages: Mapepire or ODBC for Db2 for i data, and itoolkit for calling RPG and CL programs.
Mapepire
An open-source database access layer for Db2 for i, created by IBM and introduced in an August 2024 IBM blog post as a lighter, cloud-friendly alternative to ODBC and JDBC. A server daemon runs on IBM i and Node.js, Python, Java, and .NET Core clients connect to it over Secure WebSockets.
IBM i MCP Server
An open-source, IBM-published server implementing the Model Context Protocol (MCP), letting AI agents and LLMs query Db2 for i data and take defined actions on IBM i using natural language. In beta since October 2025.
Db2 for i
The relational database management system built into every IBM i operating system, tightly integrated with IBM i rather than a separately installed database product.
IBM PASE for i
PASE for i is the AIX runtime built into IBM i, and it is where the open-source software behind most AI work on the platform actually runs. It ships as option 33 of 5770-SS1, has been a no-charge option since V5R2M0, and it hosts the yum-installed Node.js and Python builds under /QOpenSys/pkgs, including the Mapepire server that IBM's IBM i MCP Server connects through on port 8076.
RPG
Report Program Generator, the primary business application programming language on IBM i and its AS/400 predecessors, still running the majority of production logic in most IBM i shops.