First step is to configure the Apache so it will run CGI programs.

Next, since you are not reading anything from the "caller", you can just
create a varying field with your output and send it to QtmhWrStout

A sample:

 **  Llamar como: StdOut(texto: longTexto: qusec)           
D    StdOut       PR                  ExtProc('QtmhWrStout')
D  OutBuffer                  2048A   const                 
D  OutBufferLen                 10I 0 const                 
D  ErrorBuffer                  16                          
D QUSEC           DS                                        
D  QUSBPRV                      10I 0 Inz(%size(QUSEC))     
D  QUSBAVL                      10I 0                       
D  QUSEI                         7                          
D  QUSERVED                      1                          

On 08/27/2018 04:35 PM, Booth Martin wrote:
You are correct, Scott.  I am confused. And still am confused.

My goal is to provide a very simple web service.  The example I am
learning with is a DB2 file of 10 to 20 records, each with a state and
a city field.  A green screen program maintains the file.  The
additional, new piece that I am trying to make work is an Intranet web
service that offers that data, in a JSON format, to anyone who asks
for it.

My presumption was that there would be an SQLRPGLE program, that when
asked, would read the DB2 file and provide a .json data stream that a
javascript file could GET and process as the web folks chose, for
their needs.

This DB2-to-web page task already works if I write a .json file to the
IFS and deal with it as an IFS HTTP website.  So, I know the general
process works.  The hang-up for me is the web service piece.

I shall read the slide show presentation one more time.

Your initial premise really is correct; I am confused.  By the way, in
case I forget, I really appreciate all the stuff you have offered and
all that I have learned from you.  Thank you Scott.

On 8/26/2018 11:03 PM, Scott Klement wrote:

It sounds to me as if you are confusing two different things.

IWS (which uses QWSERVICE as a default userid, and runs under Java,
explaining the reason you're getting these Java errors) does not
require you to write data to STDOUT.

IWS does all of the XML/JSON work for you, and passes you
input/output as parameters.

If you want to read/write your documents yourself using stdin/stdout,
do not use IWS, but instead using a normal Apache server.  (i.e. an
HTTP server, NOT a web services server.)

My documents have examples of both ways, and it sounds like you are
confusing the two.

-- Este e-mail fue enviado desde el Mail Server del diario ABC Color --
-- Verificado por Anti-Virus Corporativo Symantec --

This thread ...


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

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