|
Thanks again Nadir. I have some higher priority work today but hopefully
I'll be able to attempt to reproduce your tests tomorrow.
Thanks,
Rob
On Mon, Aug 3, 2020 at 12:37 PM Nadir Amra <amra@xxxxxxxxxx> wrote:
Update urls so that they would be visible....
"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 08/03/2020
11:31:34
AM:
From: "Nadir Amra" <amra@xxxxxxxxxx>%CHAR(warehouse)
To: "Web Enabling the IBM i \(AS/400 and iSeries\)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 08/03/2020 11:31 AM
Subject: [EXTERNAL] Re: [WEB400] IWS, REST and retrieving variables
from QUERY_STRING
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>
I created a simple procedure as follows:
**free
CTL-OPT NOMAIN PGMINFO(*PCML:*MODULE:*DCLCASE);
dcl-proc GetAllClaims export;
dcl-pi *n extproc(*dclcase);
store ZONED(8 : 0) const;
warehouse ZONED(8 : 0) const;
status varchar(100) const;
outBuffer varchar(1000);
end-pi;
outBuffer = 'store=' + %CHAR(store) + '; warehouse=' +
+ '; status=' + status;http://host.ibm.com:10010/web/services/INJECT/123/?warehouse=444&status=up
return;
end-proc GetAllClaims;
I deployed with following attributes:
Procedure name: GetAllClaims
HTTP request method: GET
URI path template for method: {store: \d{1,3}}
HTTP response code output parameter: *NONE
HTTP header array output parameter: *NONE
HTTP header information: *NONE
Error response output parameter:
Allowed input media types: *ALL
Returned output media types: *JSON
Identifier for input wrapper element: GetAllClaimsInput
Identifier for input wrapper element: GetAllClaimsResult
Input parameter mappings:
Parameter name Data type Input source Identifier Default
Value
store zoned *PATH_PARAM store *NONE
warehouse zoned *QUERY_PARAM warehouse 0
status varchar *QUERY_PARAM status *NONE
And I did not have any problems. When I used URL:
https://urldefense.proofpoint.com/v2/url?http://host.ibm.com:10010/web/services/INJECT/123/?warehouse=444 , I
, I got:
{"outBuffer":"store=123; warehouse=0; status="}
When I used
got:http://host.ibm.com:10010/web/services/INJECT/123/?warehouse=444&status=up
{"outBuffer":"store=123; warehouse=444; status="}
When I used
, I got:
PTF[1]
{"outBuffer":"store=123; warehouse=444; status=up"}
If you are still having problems, then you should load latest IWS
and it would be a good idea to load latest HTTP group PTF[2].09:29:56
[1] https://www.ibm.com/support/pages/node/1138612
[2] https://www.ibm.com/support/pages/node/6211843
"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 08/03/2020
AM:variables
From: 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
Astryingfrom QUERY_STRING
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>
I was unsuccessful in what I was trying so let me post what I'm
to
do so someone can comment on if I'm taking the correct approach.
allstated
earlier I am using IWS.
I have an API /web/services/claims If I call this I ant return
options(*varsize);188.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
so
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)
9),httpStatus int(10);
httpHeaders char(100) dim(10);
end-pi;
When I enter this in the wizard on Deploy New Service (step 9 of
onpath
the
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
stores.template?)
/web/services/claims/0 All claims are returned for all
(Inreturned
statement)the
code if the store = 0 then store is not added to the prepared
/web/services/claims/188 Only claims for store 188 are
notwhich
is correct.
/web/services/claims/188/?warehouse=93 and
/web/services/claims/188/?warehouse=93&stat=C Both filters do
work.
--
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
list
To post a message email: WEB400@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: WEB400-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.
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.