Is the call coming in over the Internet or over a private network or VPN connection ?
First and foremost that's a consideration for potential exposures.
Also how much volume ? (CPU exposure and rate limiting needed to be considered)
Since you're using node you can:
-Write your own REST service with:
Node (Can use the node toolkit which uses XMLSERVICE)
RPG (ILEAstic or CGI)
Python
Java
-Use IWS to expose RPG calls as REST
If on an internal/secure network you could use:
-Mapepire, but your interactions would be using Web Sockets, plus it's still pretty new. (limited to CL commands and SQL I believe)
-Connect to XMLSERVICE over http, odbc or SSH
-Connect directly via ODBC.
If external:
-Are you able to llimit the IP addresses hitting the app ?
-Do you have an external firewall with rate limiting ? (Cloudflare or something similar)
For you if Node is your thing, creating the service in Node may be the best option.
If each call is truly a few milliseconds, you can probably make the call and just wait for the response sending back the PF outfile results.
Hope this helps.
Regards,
Richard Schoen
Web:
http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
----------------------------------------------------------------------
message: 1
date: Wed, 6 May 2026 12:01:29 +0200
from: Luca Giammattei <luca.giammattei@xxxxxxxxx>
subject: Call a rpg program from a node script running on an external
windows or linux server
Hi everyone, I may soon find myself in the situation in question: a web app running on a Linux or Windows server needs to access data on the Power Server.
Obviously, this involves structured information based on a well-defined and consolidated calculation in a business logic managed by three RPG programs that have been doing their job effectively for 20 years. The only change was made about twenty years ago, and a parameter was added to the programs that simply creates an PF-DTA object as an output file with this data to be later managed.
So, back to the point: what's the best way to allow a Node.js script running on a Linux (or Windows) server to connect with a specific user to a Power Server on IBM i 7.3 or 7.5 and make a call pgm1(parm1); wait a few milliseconds for the execution time and then retrieve a database file? Has anyone had similar experiences? Perhaps encapsulate the pgm in an SQL function?
Thanks in advance to anyone who can share their experiences.
As an Amazon Associate we earn from qualifying purchases.