× 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.



Has anyone ever used PCML stmf on ifs for multiple procedures/modules rolled up into a single SRVPGM? Aside from Varchar on 7.1 issue, it worked fine for me when Pcml data was in module (not ifs file). I'm assuming if you have ABC001 and ABC002 modules in ABCSRVPGM, you'd have to build a combined PCML on IFS of the contents of both of their individual STMFs. If that is true, does anyone have an example of how that would look?

Thanks again!

From: Stephen Piland
Sent: Wednesday, April 10, 2019 2:40 PM
To: web400@xxxxxxxxxxxxxxxxxx
Subject: RE: IWS REST GET Variable Length PATH_PARM Input

Nadir.. Thanks so much! Finally got it working.

From: Stephen Piland
Sent: Monday, April 8, 2019 5:31 PM
To: 'web400@xxxxxxxxxxxxxxxxxx' <web400@xxxxxxxxxxxxxxxxxx<mailto: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.

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-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.