|
tryingFrom: Robert Rogerson <rogersonra@xxxxxxxxx><web400@xxxxxxxxxxxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
Date: 08/02/2020 08:12 PM
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
188.to
do so someone can comment on if I'm taking the correct approach. Asstated
earlier I am using IWS.
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
statusBut
I also want to be able to filter the results by warehouse and/or
onso
I'm thinking these would be injected(?) into the query string
/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),
(Inthe
Methods tab I see
*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.
statement)the
code if the store = 0 then store is not added to the prepared
work./web/services/claims/188 Only claims for store 188 are returnedwhich
is correct.
/web/services/claims/188/?warehouse=93 and
/web/services/claims/188/?warehouse=93&stat=C Both filters do not
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.