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



Thanks Nadir,

Your explanation of the query parms was very helpful. I will change my
code to use varchar and check the length.

As for the configuration request the script getConfigurationFile.sh is not
on our system. I'm going to check if I can have PTFs applied. But in the
mean time is there anything else I can do?

Thanks,

Rob

On Sun, Aug 2, 2020 at 9:46 PM Nadir Amra <amra@xxxxxxxxxx> wrote:

Hi,

Because the store is a path template variable, it must be specified.
Nothing precludes you from defining another procedure without the path
template variable. Anyway, that is why /web/services/claims fails.

As far as the other statements, they URLs seems to be correct. If
variables are not specified, you will get the implicit defaults. For
characters, you will get blanks, for numbers you will get zero. So I am
not sure what you mean when you say:

warehouse = 000 and stat = ' '.
I thought that I only had to refer to them when they were injected(?)
into the *QUERY_PARAM.

There is an easy way to determine whether a character string was set or
not, and that is by use varchar. The length will be set to zero if not
specified. Since these are query parameters, you can set a default.
Setting a default allows you to check to see if fields are set.

Now if you are asking why the values are not injected into the parameters,
that I am not sure. What release are you running on? If you go to
/qibm/proddata/os/webservices/bin and run the following in QShell:

getConfigurationFile.sh -server <your-server> -serviceList <yourservice>
-locationDirectory /tmp

this will product a <yourservice>.properties and <yourservice>.xml file in
directory /tmp. If you send me the files I can take a quick look.



"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 08/02/2020 08:12:14
PM:

From: Robert Rogerson <rogersonra@xxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
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 trying
to
do so someone can comment on if I'm taking the correct approach. As
stated
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 188.
But
I also want to be able to filter the results by warehouse and/or status
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) 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
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 path
template?)
/web/services/claims/0 All claims are returned for all stores. (In
the
code if the store = 0 then store is not added to the prepared statement)
/web/services/claims/188 Only claims for store 188 are returned
which
is correct.
/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
variables
are not set. warehouse = 000 and stat = ' '.
I thought that I only had to refer to them when they were injected(?)
into
the *QUERY_PARAM.

Any and all guidance will be gladly appreciated.



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