Nadir.. Thanks so much! Finally got it working.
From: Stephen Piland
Sent: Monday, April 8, 2019 5:31 PM
To: 'web400@xxxxxxxxxxxxxxxxxx' <web400@xxxxxxxxxxxxxxxxxx>
Subject: RE: IWS REST GET Variable Length PATH_PARM Input
Sorry about that. I'm getting HTTP 404 Not Found.
From: Stephen Piland
Sent: Monday, April 8, 2019 4:54 PM
To: 'web400@xxxxxxxxxxxxxxxxxx' <web400@xxxxxxxxxxxxxxxxxx<mailto:web400@xxxxxxxxxxxxxxxxxx>>
Subject: RE: IWS REST GET Variable Length PATH_PARM Input
Thanks again Nadir for the very good details. I'm still having an issue though.
It did detect and recognize varchar(50) as seen below in the Service properties. However when I call the GET method in Postman, I get a HTTP 400 when I specify anything less that 50, but it works with exactly 50 and returns a HTTP 200.
http://{server}/web/services/CACRTV/12345678901234567890123456789012345678901234567890<
http://%7bserver%7d/web/services/CACRTV/12345678901234567890123456789012345678901234567890>
Procedure name:
CACRTV
HTTP request method:
GET
URI path template for method:
{id: \w{50}}
HTTP response code output parameter:
HTTPSTATUS
HTTP header array output parameter:
HTTPHEADERS
Allowed input media types:
*ALL
Returned output media types:
*JSON
Input parameter mappings:
Parameter name
Data type
Input source
Identifier
Default Value
INECOMMORDERNO
varchar
*PATH_PARAM
id
*NONE
RPG Code...
Dcl-Proc CACRTV;
Dcl-pi *n;
inECommOrderNo varchar(50) const;
httpStatus int(10);
httpHeaders char(100) dim(10);
rtnOrder likeds(rtnOrderInfo);
End-pi;
From: Stephen Piland
Sent: Saturday, April 6, 2019 12:59 PM
To: 'web400@xxxxxxxxxxxxxxxxxx' <web400@xxxxxxxxxxxxxxxxxx<mailto:web400@xxxxxxxxxxxxxxxxxx>>
Subject: RE: IWS REST GET Variable Length PATH_PARM Input
For clarity sake, I've reworked my procedures/srvpgm to be a stand alone RPG pgm. I tried in the PCML both CACTST (object) and RETRIEVE which is the MainProcedure. I'm still getting ZUI_53179. Reference notes below...
Nadir.. Where are you getting your information from? Is there a reference or white paper? I'd like to not have to bug the group so much but I find documentation lacking from IBM. I appreciate your help. My one wish would be for 7.3 but stuck on 7.1 for a while.
Modified PCML on IFS...
</struct>
<!-- 50 -->
<program name="CACTST" path="/QSYS.LIB/CCLIB.LIB/CACTST.PGM">
<data name="INECOMMORDERNO" type="varchar" length="50" usage="input">
<data name="HTTPSTATUS" type="int" length="4" precision="31" usage="inputoutput" />
<data name="HTTPHEADERS" type="char" length="100" count="10" usage="inputoutput" />
<data name="RTNORDER" type="struct" struct="RTNORDERINFO" usage="inputoutput" />
</program>
</pcml>
Prototype below...
dcl-pr retrieve extpgm('CACTST');
rtnECommOrderNo varchar(50) const;
httpStatus int(10);
httpHeaders char(100) dim(10);
rtnOrder likeds(rtnOrderInfo);
End-Pr;
From: Stephen Piland
Sent: Thursday, April 4, 2019 7:11 PM
To: 'web400@xxxxxxxxxxxxxxxxxx' <web400@xxxxxxxxxxxxxxxxxx<mailto:web400@xxxxxxxxxxxxxxxxxx>>
Subject: Re: IWS REST GET Variable Length PATH_PARM Input
Finally have the necessary PTFs installed and I've created PCML 6.0 to the IFS for a module that contains 2 procedures. One would be for a POST and one for a GET. I have tried to deploy the web service and when I pick the modified or unmodified PCML in IWS, I get the error message below. Any ideas? Thanks!
ZUI_53179: The PCML file is not valid for the program object specified. Click on the Browse button to navigate the directory and find the correct PCML file. Correct the path and try the request again or specify another program object
Originally generated PCML for varchar InECommOrderNo...
<program name="RETRIEVE" entrypoint="RETRIEVE">
<struct name="INECOMMORDERNO" usage="input">
<data name="length" type="int" length="2" precision="16" usage="inherit" />
<data name="string" type="char" length="length" usage="inherit" />
</struct>
<data name="HTTPSTATUS" type="int" length="4" precision="31" usage="inputoutput" />
<data name="HTTPHEADERS" type="char" length="100" count="10" usage="inputoutput" />
<data name="RTNORDER" type="struct" struct="RTNORDERINFO" usage="inputoutput" />
</program>
Modified PCML for varchar inECommOrderNo...
<program name="RETRIEVE" entrypoint="RETRIEVE">
<data name="INECOMMORDERNO" type="varchar" length="50" usage="input">
<data name="HTTPSTATUS" type="int" length="4" precision="31" usage="inputoutput" />
<data name="HTTPHEADERS" type="char" length="100" count="10" usage="inputoutput" />
<data name="RTNORDER" type="struct" struct="RTNORDERINFO" usage="inputoutput" />
</program>
As an Amazon Associate we earn from qualifying purchases.