Re: Receiving/Returning DS and Arrays using IWS

Marco Facchinetti <marco.facchinetti-kthxv0ud/[email protected]> Mon, 20 Jan 2025 16:23:23 +0100
Newsgroups gmane.comp.systems.as400.web
Message-ID <CAMsgu4rTeHBxY0cpYGmJEWRZdyxaMOLQu2pmoiYFN4GYBQM0JQ@mail.gmail.com>
Hi Jerry, some links:

https://www.ibm.com/support/pages/integrated-web-services-ibm-i-web-services-made-easy
https://www.ibm.com/support/pages/node/1138612
https://www.ibm.com/support/pages/integrated-web-services-articles

Related: https://www.ibm.com/support/pages/node/6982701

When you have arrays and deploy a service selecting "Detect fields length"
you can code:

Dcl-ds MyDs qualified inz;
  Pairs_LENGTH int(10) inz(0);
  Dcl-Ds Pairs dim(5000);
    vKey varchar(20) inz('');
    vValue varchar(200) inz('');
  End-Ds;
End-Ds;

If MyDs.Pairs has 396 elements with data set MyDs.Pairs_LENGTH = 396;

And IWS will produce only the requested numbers (in this case 396) in
response instead of 5000.

HTH
--
Marco Facchinetti

Mr S.r.l.

Tel. 035 962885
Cel. 393 9620498

Skype: facchinettimarco


Il giorno lun 20 gen 2025 alle ore 13:15 (WalzCraft) Jerry Forss <
[email protected]> ha scritto:

> Does anyone have a doc on how to receive/return DS and Arrays from IWS?
>
> I have done a couple that are just using input parameters that return a
> basic json.
>
>
>
>
> Subject to Change Notice:
>
> WalzCraft reserves the right to improve designs, and to change
> specifications without notice.
>
> Confidentiality Notice:
>
> This message and any attachments may contain confidential and privileged
> information that is protected by law. The information contained herein is
> transmitted for the sole use of the intended recipient(s) and should "only"
> pertain to "WalzCraft" company matters. If you are not the intended
> recipient or designated agent of the recipient of such information, you are
> hereby notified that any use, dissemination, copying or retention of this
> email or the information contained herein is strictly prohibited and may
> subject you to penalties under federal and/or state law. If you received
> this email in error, please notify the sender immediately and permanently
> delete this email. Thank You
>
> WalzCraft PO Box 1748 La Crosse, WI, 54602-1748
> www.walzcraft.com<http://www.walzcraft.com> Phone: 1-800-237-1326
> --
> This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing
> list
> To post a message email: [email protected]
> To subscribe, unsubscribe, or change list options,
> visit: https://lists.midrange.com/mailman/listinfo/web400
> or email: [email protected]
> Before posting, please take a moment to review the archives
> at https://archive.midrange.com/web400.
>
>
-- 
This is the Web Enabling the IBM i (AS/400 and iSeries) (WEB400) mailing list
To post a message email: [email protected]
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/web400
or email: [email protected]
Before posting, please take a moment to review the archives
at https://archive.midrange.com/web400.