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



Perhaps I'm missing a PTF then because this is not what I'm seeing on two levels.

First I only get the opportunity to associate a length field if I do NOT select "detect length fields".

Second I had a packed field originally but was only able to get it to work after I switched to int (which is what the docs say).

See this video here so you know I'm not making this up!

https://www.screencast.com/t/eKQkV2xG4l


Jon Paris

www.partner400.com
www.SystemiDeveloper.com

On Jul 16, 2019, at 6:26 PM, Nadir Amra <amra@xxxxxxxxxx> wrote:

Jon, and others,

When dealing with output arrays (e,g, an array being returned as a
response by the web service), the recommended step is to select "detect
length fields" and add a length field PRIOR to the output array. At one
time the length field was limited to integer data types, but that is no
longer the case (depending on how current you are with PTFs).

So in the following example, things look correct:

dcl-pi RestSrv4 ExtPgm;
requestedCat Like(catcod);
result char(20);
productList_LENGTH packed(5);
productList LikeDS(product) Dim(20);
end-pi;

I am assuming that productList_LENGTH and productList are output
parameters,

So, in the RPG code, I would expect productList_LENGTH to be initialized
to zero. Then there would be some sort of loop where the productList
array is filled. And if you filled the array with 5 elements, then you
need to set the productList_LENGTH field to 5. That is it,



"WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx> wrote on 07/16/2019 03:49:05
PM:

From: Jon Paris <jon.paris@xxxxxxxxxxxxxx>
To: "Web Enabling the IBM i (AS/400 and iSeries)"
<web400@xxxxxxxxxxxxxxxxxx>
Date: 07/16/2019 03:50 PM
Subject: [EXTERNAL] Re: [WEB400] Weird IWS Bug (?)
Sent by: "WEB400" <web400-bounces@xxxxxxxxxxxxxxxxxx>

That is what I thought I was achieving _by_ selecting the Detect
Length option Anshul. Guess I had it back to front.

It just tried redeploying and deselected the detect length but no
other options appear and PRODUCTLIST_LENGTH still appears in the output.

Can you tell me what the name of the box I'm looking for is and on
what screen it appears.




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