Booth,

What you want is not simple; there are reasons there are so many ancillary products :-) There is quite some plumbing involved.

Let's look at the web service:
- First you have to configure an HTTP server to start your program for a certain request. Configuring HTTP servers is an art in itself; the IBM manual is, let's put it mildly, challenging
- Then, when you manage to get your program started, it will possibly need one or more parameters. Depending on whether you used GET or POST you have to parse them out of environment variable QUERY_STRING or read stdin (a special file handle; you will need to delve into C library routines to use it - or go directly to Scott Klement's  site <https://www.scottklement.com/rpg/ifs_ebook/ifs_ebook.html>)
- Your program has to send its output to stdout (another special file handle), where the HTTP server will transport it to the requester
- You have to realize that data flowing in and out of the HTTP server is not EBCDIC (probably UTF-8) and the data in your program is; so you will have to know if and when automatic translations occur (also a part of the HTTP server configuration) or deal with UTF-8 directly (that is possible, these days).

As you see, there is quite a lot of knowledge required for an apparently simple web service.

Joep Beckeringh


Op 9-8-2018 om 19:14 schreef Booth Martin:
This has to be simpler than I am making it.  I have a web page ( louie.martinvt.com ) that presents a simple page of states and cities.  It is populated with a .json file located with the page.

The actual .json file is produced with an RPGLE program (using Scott's YAJL) and a regular physical file.  My intention is to have an RPG web service provide that .json file and it be accepted by my web page's javascript.  I have used Scott's program for that but I am missing something.

So far, all of the articles & examples I find discuss solutions requiring php, jquery, or some other ancillary product.

I have looked for a simple "Hello World" solution that goes end-to-end and had no luck.

Any examples or tutorials that are dumbed way down, so I can at least see what it is I am supposed to be doing?


This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2019 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].