Go it. Wasn't setting the Response_Length.

-----Original Message-----
From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of (WalzCraft) Jerry Forss
Sent: Monday, May 12, 2025 8:41 AM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxxxxxxxx>
Subject: Re: [WEB400] External Re: Web Service Return DS Array

Here is what I have

Dcl-DS Types Qualified Template Inz;
Type Char(2);
Description Char(25);
End-Ds;

Dcl-pr WOMOrdTyRn;
Envir Char(2);
Response_LENGTH Int(10);
Response LikeDS(Types) Dim(20);
Fail Char(100);
End-pr;

Dcl-pi WOMOrdTyRn;
Envir Char(2);
Response_LENGTH Int(10);
Response LikeDS(Types) Dim(20);
Fail Char(100);
End-pi;

When I run in debug, Response is loaded.

EVAL Response
RESPONSE.TYPE(1) = 'DS'
RESPONSE.DESCRIPTION(1) = 'Drop Ship '
RESPONSE.TYPE(2) = 'EX'
RESPONSE.DESCRIPTION(2) = 'Expedited Order '
RESPONSE.TYPE(3) = 'LT'
RESPONSE.DESCRIPTION(3) = 'Literature Packed '
RESPONSE.TYPE(4) = 'NC'
RESPONSE.DESCRIPTION(4) = 'No Charge '
RESPONSE.TYPE(5) = 'RM'
RESPONSE.DESCRIPTION(5) = 'Remake '
RESPONSE.TYPE(6) = 'RW'
RESPONSE.DESCRIPTION(6) = 'Re-Work '
RESPONSE.TYPE(7) = 'SL'

When I run the service from Postman I get no data

{
"RESPONSE": [],
"FAIL": ""
}

It had the Response as a structure .

Is there something else I need to do in the service?

-----Original Message-----
From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Nadir K Amra
Sent: Monday, May 12, 2025 8:11 AM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxxxxxxxx>
Subject: External Re: [WEB400] Web Service Return DS Array

CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.

You need to define type and description as part of data structure and define that field as an array. Something like:

dcl-ds Thing qualified template;
Type Char(2);
Description Char(25);
end-ds;

Dcl-pr WOMOrdTypR;
Envir Char(2);
Things_LENGTH int(10);
Things likeds(Thing) Dim(20);
Fail Char(100);
End-pr;

Dcl-pi WOMOrdTypR;
Envir Char(2);
Things_LENGTH int(10);
Things likeds(Thing) Dim(20);
Fail Char(100);
End-pi;

-----------------------------------------------
Nadir Amra
e-mail: amra@xxxxxxxxxx


From: WEB400 <web400-bounces@xxxxxxxxxxxxxxxxxx> on behalf of (WalzCraft) Jerry Forss <JForss@xxxxxxxxxxxxx>
Date: Monday, May 12, 2025 at 7:54 AM
To: Web Enabling the IBM i (AS/400 and iSeries) <web400@xxxxxxxxxxxxxxxxxx>
Subject: [EXTERNAL] [WEB400] Web Service Return DS Array Hi All

Cross posting to RPG list as well.

In my current pgm that is called from my Web Server I return arrays for each element.
I want to return a DS array instead.

Current Parameters

Dcl-pr WOMOrdTypR;
Envir Char(2);
Type Char(2) Dim(20);
Description Char(25) Dim(20);
Fail Char(100);
End-pr;

Dcl-pi WOMOrdTypR;
Envir Char(2);
Type Char(2) Dim(20);
Description Char(25) Dim(20);
Fail Char(100);
End-pi;

Which returns this from the service


{

"TYPE": [

"DS",

"EX",

"LT",

"NC",

"RM",

"RW",

"SL",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

""

],

"DESCRIPTION": [

"Drop Ship",

"Expedited Order",

"Literature Packed",

"No Charge",

"Remake",

"Re-Work",

"Standard Lead",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

"",

""

],

"FAIL": ""

}


I want it to return

[
{
"TYPE": "DS",
"DESCRIPTION": "Drop Ship"
},
{
"TYPE": "EX",
"DESCRIPTION": "Expedited Order"
},
{
"TYPE": "LT",
"DESCRIPTION": "Literature Packed"
}
]


How do I define this as a DS so the service returns what I want?
I am looking for some good documentation on templates, I am assuming this is what I want but have never used it.




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




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

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2025 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.