This is exactly the approach I would use (except I'd always call stored procedures), and in fact I already do use this method with Express/MariaDb for another project I've developed. In addition to the REQUEST_BODY and RESPONSE_BODY, I also extract the headers and cookies etc. into a JSON structure to be passed to the called stored procedure and I allow headers, cookies, HTTP response code etc. to be set in a returned JSON structure, so there are an additional two JSON parameters: Customers_GET(REQUEST_HEADERS, REQUEST_BODY, RESPONSE_HEADERS, RESPONSE_BODY);

Tim.

________________________________
From: RPG400-L <rpg400-l-bounces@xxxxxxxxxxxxxxxxxx> on behalf of Jay Vaughn <jeffersonvaughn@xxxxxxxxx>
Sent: 24 January 2022 02:13
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: YAJL in Event Processing Mode

Using an Apache server instance works well and is very fast.
Very simple to setup and effective using it for REST architecture, especially in those shops with old school rpg programmers.

Help your staff out by writing a simple “landing” program that offloads the request from the server then looks up an appropriate native rpg pgm to call passing it two parms. 1) in = request json 2) out = response json.

Your team can write simple rpg pgms that accept this request parm, parse it with sql json function, then produce the response packing it back up with sql json functions.

Your devs never have to interface with any http stuff at all. They just need to learn how to work with json. And between data-into, YAJL, sql, they will get by just fine. My suggestion is to use the sql functions.

I would choose this over IWS over ILEAstic any day.

Good luck.

Jay

On Jan 19, 2022, at 8:11 PM, Richard Schoen <richard@xxxxxxxxxxxxxxxxx> wrote:

If you want to stick with RPG, check out ILEAstic to create an entire RPG based Web Server or REST service app.

You can serve up pretty much any database call or RPG/CL program call that you need as a service without needed an Apache Server instance.

Handles the JSON stuff as well.

https://sitemule.github.io/ileastic/about.html

https://github.com/sitemule/ILEastic

Regards,
Richard Schoen
Web: http://www.richardschoen.net
Email: richard@xxxxxxxxxxxxxxxxx
------------------------------

message: 5
date: Wed, 19 Jan 2022 15:34:35 -0800
from: Alan Campin <alan0307d@xxxxxxxxx>
subject: Re: YAJL in Event Processing Mode

Nothing specific. I am trying to convince the company to go to Rest
Services instead of using stored procedure calls and passing parameters. I
am looking at how to parse the JSON that would be sent. In the past
when I did XML, I always used XML-SAX. It was simple and easy to use(At
least it was to me) and I wanted to see how easy or hard it would be to use
with JSON but everything is about using trees.

Probably won't be able to sell it in any case.

--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
--
This is the RPG programming on IBM i (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.

Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2022 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.