One other thing to note about this solution:
Because this version uses program parms instead of a return value from a service program function, there was no "RTNPARM" used. (I'd stated earlier that I had used RTNPARM to get around the IWS 4-byte integer limitation on the return variable).
-- Michael
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Koester, Michael
Sent: Wednesday, December 31, 2014 9:49 AM
To: Midrange Systems Technical Discussion
Subject: RE: IWS needs web service to return only the array rows used

As I stated earlier, I was able to get IWS to return XML for 4 dimensioned
data structures using a *pgm that has parameters that IWS sees as output
structures. Note that the IWS Test function throws an error if I don't
load a zero in each of the numeric "count" fields (and all numeric ds
subfields) in the request inputs.

I have not included the prototypes for my attempts that didn't work (there
were many!), but...

Here is the prototype and referenced data structures for the *pgm version
that permits me to define the actual dimensions where I get the desired
XML result:
Account char(7) CONST;
PhoneIn char(13) CONST;
Email char(64) CONST;
AccountDetails LikeDS(Set1);
PhonesCount INT(10);
Phone LIKEDS(Set2) DIM(32);
PDFsCount INT(10);
PaymentsCount INT(10);
Payment LIKEDS(Set4) DIM(16);
EmailCount INT(10);
EmailAddr LIKEDS(Set5) DIM(16);

// fields that pertain to the account
Success IND;
MsgText CHAR(128);
DateDue CHAR(10);
NextAutoPayDate CHAR(10);

// fields that pertain to each phone number
PhoneNumber PACKED(10:0);
Autopay IND;
NoPaper IND;
Notify IND;
AmtDue PACKED(8:2);
BankRouting PACKED(9:0);
BankAccount CHAR(16);
AccountType CHAR(1);

// fields that pertain to each PDF available to view
PDFname CHAR(23);

// fields that pertain to the prior payments
PhoneNumber PACKED(10:0);
Amount PACKED(8:2);
PaidDate CHAR(10);
Status CHAR(16);

PhoneNumber PACKED(10:0);
EmailTo CHAR(50);

I agree that the IWS Test function is not all I would like it to be, but
it shows me the following output from my test data. Note that this test
only loaded two of the four array data structures, so you don't see the
"PDF" and "EmailAddr" tags or the tags for their subfields.
<?xml version="1.0" encoding="UTF-8"?>
<MSGTEXT>Customer account is valid</MSGTEXT>
-- Michael
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf Of
Jon Paris
Sent: Tuesday, December 30, 2014 7:01 PM
To: Midrange-L Midrange-l
Subject: Re: IWS needs web service to return only the array rows used

OK - that makes much more sense. I wondered if you were using the
RTNPARM technique.

Look forward to seeing the protos.

Jon Paris

On Dec 30, 2014, at 6:04 PM, Koester, Michael <mkoester@xxxxxxxxxxxxx>

True enough, the program isn't "returning" anything, but the input
that aren't designated CONST just might get loaded in the program
making that payload accessible to the caller. IWS recognizes those as
input/output, and if dimensioned, they get a COUNT value associated
with them. In the "Select Export Procedures to Externalize as a Web
Service - Step 4 of 9" stage, I can stuff a integer variable name in
to restricts the array to that many occurrences. My program increments
that variable as I load the array, and IWS requires that the integer
variable be among the I/O parameters.

The part about functions needing to return the 4-byte integer to IWS
circumvented by specifying RTNPARM on the PR/PI.
Sorry to confuse. I'll get the "working version" of the prototypes
you tomorrow (assuming I can replicate the piece that worked earlier
today before I "messed with it").

-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxx] On Behalf
Of Jon Paris
Sent: Tuesday, December 30, 2014 5:37 PM
To: Midrange-L Midrange-l
Subject: Re: IWS needs web service to return only the array rows

I'm confused Michael,

You say you "return a data structure" - but a) Programs can't
anything and b) A service program function can return a DS - but
would still not work with IWS because it can't handle anything
except a 4 byte integer as the return value.

That would imply that you are always returning the values via I/O
parameters which makes your earlier comments about switching the
way you handled the results really confusing.

Can you clarify please _exactly_ what your prototypes look like in
the case where it works (the *PGM case?) and those where it doesn't.

Jon Paris

This thread ...


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

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