Re: Call a rpg program from a node script running on an external windows or linux server

Luca Giammattei <[email protected]> Wed, 6 May 2026 16:32:24 +0200
Newsgroups gmane.comp.lang.as400.rpg
Message-ID <[email protected]>
Il 06/05/2026 15:42, Richard Schoen ha scritto:
> 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.

the two servers (the power one and the webapp one) sits on the same lan

> Also how much volume ? (CPU exposure and rate limiting needed to be considered)

we're expecting few thousands requests per day, the RPGILE part is really 
optimized to the maximum, and the number of requests does not cause us any 
particular problems

> 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.

I'm in charge for the power server/IBM i/rpg ile part of the game. and I should 
find a way to allow access to this information to whoever is implementing the 
nodejs part.

Ultimately, I think the cleanest choice is IWS. Even though I don't like the 
complications of deploying it.

The Node Toolkit uses XMLSERVICE under the hood, so I'd always have to manage an 
HTTP server instance. XMLSERVICE has its advantages and disadvantages, too.
Ultimately, I think I can encapsulate the execution of pgm1 more easily with IWS 
than with other tools and return the response as JSON, avoiding other "weird" 
processing on the other end.


> 
> Hope this helps.

Sure it does, it's always good to put your ideas in order by writing about them 
with people who know about them
-- 
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request-+hD5IHI5Xscn3HwCXmMcX9BPR1lH4CV8@public.gmane.org
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support-FMtJrHiV//lnDLsaKlm4mFaTQe2KTcn/@public.gmane.org for any subscription related questions.