I must say that your solution appears to be well beyond my level of expertise, but...
I have it on good authority that IWS does not currently support what I am trying to do.
That said, I'm finding that instead of using a return value from the function, I can define what would ideally considered inputs as the data structures that get loaded in the function. Since those aren't CONST parameters, IWS sees them as multiple outputs, which allows me to set the count property of the arrays to the variables, and I get the XML structure I need. There might be a better way to get there, but until I find it, this will do.
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Sent: Monday, December 29, 2014 4:49 PM
To: Midrange Systems Technical Discussion
Subject: Re: IWS needs web service to return only the array rows used
I don't have an easy answer for this... I think you've hit upon one of
the limits of the IWS.
Personally (when I need something complex like this) is to just use
Apache to call my RPG program instead of IWS. Then, I need to do all
of the XML work myself -- which I don't find too difficult if I already
know what the XML should look like (and I can use the IWS to tell me
But, if you code the XML yourself, you can make it only return the array
elements you need very easily.
Plus, running raw RPG code will outperform the IWS.
On 12/29/2014 9:06 AM, Koester, Michael wrote:
Running iOS 7.1 (TR8, I think).service that provides data to a business partner. I need to send data in
I'll be using the Integrated Web Services wizard to generate a web
the form of multiple arrays. I am able to do this by having the service
program function return data structures shown in D-specs similar to below
(simplified a bit here), but the actual number of array rows used will
vary, up to the dim limits.
perfect, except that I need to find a way to restrict the output from
D PR Extproc('EBPPTEST3')
D likeDS(rtnDS) RTNPARM
D Account 7a const
D Phone 13a const
D EmailIn 64a const
D rtnDS ds qualified
D Account likeDS(Set1)
D PhonesCount 10i 0
D Phone likeDS(Set2) dim(32)
D PaymentsCount 10i 0
D Payment likeDS(Set3) dim(16)
* fields that pertain to Account
d Set1 ds qualified inz
d Success n inz
d MsgText 128a
d DateDue 10a
* fields that pertain to each phone on account
d Set2 ds qualified inz
d PhoneNumber 10 0 inz
d AmtDue 8 2 inz
d BankRouting 9 0 inz
d BankAccount 16a
* fields that pertain to each prior payment
d Set3 ds qualified inz
d PhoneNumber 10 0 inz
d Amount 8 2 inz
d PaidDate 10a
d Status 16a
When I test the web service, the resulting XML is pretty close to
including all the "empty" array rows. For the "Set2" stuff, I get XML for
all 32 rows, when only 2 rows are used:
an opportunity in the wizard to define the output structure count to be a
... [for all 32 rows. Same issue with the <Payment> array for
If my output was a single array, my understanding is that I might have
run-time variable instead of the dim default. My output, as a "structure
of structures" does not appear to allow me any chance at fixing the
runtime values of array rows to return?
Is there a way to specify PhonesCount and PaymentsCount someplace as the