Re: Call a rpg program from a node script running on an external windows or linux server
Richard Schoen <richard-DiTrGpQEJGItADg8e/3/[email protected]> Wed, 6 May 2026 17:30:34 +0000
| Newsgroups | gmane.comp.lang.as400.rpg |
|---|---|
| Message-ID | <DM4PR12MB526378192592B059A3D365E8B73F2@DM4PR12MB5263.namprd12.prod.outlook.com> |
Another option I would be fond of since they are on the same LAN would be t= o do the program call over ODBC (you can register your RPG program as a sto= red proc or call it directly via ODBC). And then once the call comes back simply run an SQL query to get the result= s. = But IWS should work fine as well. = Regards, Richard Schoen Web:=A0http://www.richardschoen.net Email:=A0richard-DiTrGpQEJGItADg8e/3/[email protected] ------------------------------ message: 2 date: Wed, 6 May 2026 16:32:24 +0200 from: Luca Giammattei <[email protected]> subject: Re: Call a rpg program from a node script running on an external windows or linux server 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 o= ptimized to the maximum, and the number of requests does not cause us any p= articular 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 be= st 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 sh= ould find a way to allow access to this information to whoever is implement= ing the nodejs part. Ultimately, I think the cleanest choice is IWS. Even though I don't like th= e complications of deploying it. The Node Toolkit uses XMLSERVICE under the hood, so I'd always have to mana= ge an HTTP server instance. XMLSERVICE has its advantages and disadvantages= , too. Ultimately, I think I can encapsulate the execution of pgm1 more easily wit= h 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 qu= estions.