× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Ok, I was mistaken...

It's not passed as a program variable, but as an environment variable..

The Request Information tab of the properties panel (shown in Figure 60 on
page 99) allows you to
display the transport and request information that is to be passed to the
web service implementation
code. You can update, remove, and modify the information that is to be
passed to the program object. The
information is passed to the program object in environment variables.


Page 98 of the IWS Server Admin & Programming guide
ftp://public.dhe.ibm.com/systems/support/i/iws/systems_i_software_iws_pdf_WebServicesServer_new.pdf

Simply use the Get Environment Variable (QtmhGetEnv) API to retrieve it..

Charles





On Mon, Jul 27, 2020 at 11:56 AM Robert Rogerson <rogersonra@xxxxxxxxx>
wrote:

It's really that simple? Is there a document showing/stating this? I
spent the best part of yesterday afternoon trying to get this to work and I
couldn't find any document (I must have been searching for the wrong
terms). I'd like to save a link so I don't waste my and your time in the
future.

Thanks,

Rob

On Mon, Jul 27, 2020 at 1:50 PM Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

You can't. IWS will retrieve it for you...

SImply include a variable QUERY_STRING in your program or procedure and
when you deploy the IWS web service check the QUERY_STRING metacheck
checkbox to have IWS pass it to your procedure.

Charles

On Mon, Jul 27, 2020 at 11:21 AM Robert Rogerson <rogersonra@xxxxxxxxx>
wrote:

I'm creating a webservice and using IWS. I'm then using Postman to
test
the webservice. All the endpoints call procedures in a service
program..

So I have an endpoint /web/server/claims which will call the RPG
procedure
GetAllClaims which returns all claims. I have tested this with
Postman
and it works correctly.

My next step is to add a filter. So I call the same endpoint but this
time
I pass a parameter of whid. So the endpoint now becomes
/web/server/claims/?whid=93 which will call the RPG procedure
GetAllClaims
but this time I need to extract the parameter passed in the
QUERY_STRING
to
return only claims for warehouse 93.

I'm trying to understand how to extract the parameter whid=93 from the
QUERY_STRING. I thought the article I posted gave an example of this.

Thanks,

Rob


On Mon, Jul 27, 2020 at 1:04 PM Charles Wilt <charles.wilt@xxxxxxxxx>
wrote:

That's unlikely to provide your answer...

First off, you need to clarify what you are doing?

Calling web service?

Create a web service (with or with IWS?)

Charles

On Mon, Jul 27, 2020 at 10:43 AM Robert Rogerson <
rogersonra@xxxxxxxxx

wrote:

I think I found it here (




https://ibmsystemsmag.com/Power-Systems/02/2012/rest-web-services-with-rpg
).

Thanks for putting me on the right path Charles.

Rob

On Mon, Jul 27, 2020 at 12:27 PM Robert Rogerson <
rogersonra@xxxxxxxxx

wrote:

Charles, if I add *fixed then does this stop the need to append
x'00'
to
the end of cmdstr when calling the api?

I checked in the config file for my HTTP server instance and
could
not
find %%MIXED%%. So I did a Google search and did find .
Electronic
business and Web serving IBM HTTP Server for i (





https://www.ibm.com/support/knowledgecenter/en/ssw_ibm_i_73/rzaie/rzaiepdf.pdf
).
It mentions

CGIConvMode:
Module: mod_cgi
Syntax: CGIConvMode mode

One of the modes listed is %%MIXED so I'm thinking this may be
what
you
were referring to. But this also got me thinking, from how I
understand
this, CGIConvMode is in module the module mod_cgi which is not
loaded
(LoadModule cgi_mod?).

Should I be loading cgi_mod?

OK, while writing this I just saw another post from you that I
was
doing
it wrong. Thanks

In the past I did try to find how to access the environment
variable
QUERY_STRING but the only reference I could find to access it was
using
the QzhbCgiParse api which you pointed out is wrong.

So how should I be accessing QUERY_STRING? (I don't mind if you
just
point me to a document but I couldn't find one.

Thanks,

Rob

On Mon, Jul 27, 2020 at 10:26 AM Charles Wilt <
charles.wilt@xxxxxxxxx>
wrote:

Looks ok, though you should be using option(*trim:*string) to
automatically
trim and null terminate the cmdStr parm.

Did you see the note in the docs?

This API does not work with the %%MIXED%% CGI input mode.

Are you by chance using mixed? (would be in your Apache config)

Charles



On Mon, Jul 27, 2020 at 6:21 AM Robert Rogerson <
rogersonra@xxxxxxxxx

wrote:

This is posted to both the RPG and the Midrange-L mailings
lists.

I'm using IWS to call a REST API. I'm using QzhbCgiParse to
retrieve
the
passed parameter(s) from the QUERY_STRING. When I call the
API
all
I
see
is a 1 page dump in QPSRVDMP in QEZDEBUG with the user data
FFDC
but
can't see anything other than
.SYMPTOM STRING-
5770 SP/QZHBCGI MSGMCH3601
I've used Google and the IBM API docs to research but I can't
see
the
issue. My prototype and same call follow.

Dcl-Pr QzhbCgiParse extproc('QzhbCgiParse');
cmdStr char(65535) const options(*trim: *varsize);
outFmt char(8) const;
targetBuf char(65535);
targetSize int(10) const;
responseLen int(10);
errorCode char(56);
End-Pr;


//--------------------------------------------------------------
// GetInputParameter Get the passed parameter from
QUERY_STRING

//--------------------------------------------------------------
dcl-proc GetInputParameter;
dcl-pi *n varchar(100);
pSearchParameter varchar(20) const;
end-pi;

dcl-s cmdStr char(65535);
dcl-s outFmt char(8) inz('CGII0100');
dcl-s targetBuf char(65535);
dcl-s targetSize int(10);
dcl-s responseLen int(10) inz(0);
dcl-s errorCode char(56);
dcl-s pos uns(5);

cmdStr = '-value ' + pSearchParameter + x'00';
QzhbCgiParse(cmdStr:outFmt: targetBuf: %size(targetBuf) :
responseLen
:errorcode);
dump(a);
If responseLen > 0;
pos = %SCAN(X'25':targetBuf);
Return %Trim(%Subst(targetBuf:1:pos-1));
Else;
Return ' ';
Endif;
end-proc;

I've commented out the call to QzhbCgiParse and the program
completes
without error and produces a dump (dump(a)). When I uncomment
the
call
to
QzhbCgiParse the program fails but produces no dump for
dump(a).
It
does
however create the QPSRVDMP dump I mentioned earlier.

Any help would be greatly appreciated as I've come to a brick
wall.

Thanks,

Rob
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 Midrange Systems Technical Discussion (MIDRANGE-L)
mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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-2024 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.