|
warehouse = 000 and stat = ' '.into the *QUERY_PARAM.
I thought that I only had to refer to them when they were injected(?)
From: Robert Rogerson <rogersonra@xxxxxxxxx><web400@xxxxxxxxxxxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
Date: 08/02/2020 08:12 PMto
Subject: [EXTERNAL] Re: [WEB400] IWS, REST and retrieving variables
from QUERY_STRING
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>
I was unsuccessful in what I was trying so let me post what I'm trying
do so someone can comment on if I'm taking the correct approach. Asstated
earlier I am using IWS.But
I have an API /web/services/claims If I call this I ant return all
claims. If I want all claims for an individual store I would call
/web/services/claims/188 which would return all claims for store 188.
I also want to be able to filter the results by warehouse and/or statusso
I'm thinking these would be injected(?) into the query stringthe
/web/services/claims/188/?whid=95&stat=C.
My prototype looks like this
dcl-proc GetAllClaims export;
dcl-pi *n extproc(*dclcase);
store like(ossushpTmp.o1cus#) const;
warehouse like(ossushpTmp.o1whid) const;
stat like(ossushpTmp.o1stat) const;
claimsHdrDs_length int(10);
claimsHdrDs likeds(claimsHdrDsTmp) dim(1000) options(*varsize);
httpStatus int(10);
httpHeaders char(100) dim(10);
end-pi;
When I enter this in the wizard on Deploy New Service (step 9 of 9), on
Methods tab I seethe
*Procedure name*:GetAllClaims
*HTTP **request method*:GET
*URI path template for method*:{store: \d{1,3}}
*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 nameData typeInput sourceIdentifierDefault Value
store zoned *PATH_PARAM store *NONE
warehouse zoned *QUERY_PARAM warehouse 0
status char *QUERY_PARAM status '*NONE
This looks like what I think I'm trying to achieve.
i deploy the webservice and then call.
/web/services/claims HTTP ERROR 405 (is this because of the path
template?)
/web/services/claims/0 All claims are returned for all stores. (In
code if the store = 0 then store is not added to the prepared statement)which
/web/services/claims/188 Only claims for store 188 are returned
is correct.variables
/web/services/claims/188/?warehouse=93 and
/web/services/claims/188/?warehouse=93&stat=C Both filters do not work.
I added a dump(a) just after the procedure starts and the input
are not set. warehouse = 000 and stat = ' '.into
I thought that I only had to refer to them when they were injected(?)
the *QUERY_PARAM.
Any and all guidance will be gladly appreciated.
As an Amazon Associate we earn from qualifying purchases.
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.