Focal Point
Webservices - arrays of arrays

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6281082822

May 16, 2007, 05:18 PM
sandy28
Webservices - arrays of arrays
I am consuming a web service that returns an array of arrays. I've heard something about everything coming back as a single column that required multiple defines and computes just to assemble a report.

Does anyone have any information on this?
May 18, 2007, 03:01 PM
Bernie Ott
Here's a sample of what you are talking about.

It's using the WebFOCUS List Fexes web service.

That service returns an array of info about the files in a directory on the reporting server.

Basically, in this case, it's a multi-segmented structure, and I create a counter that's associated with the 1-level-higher segment.


 
DEFINE FILE WSWF_WEBFOCUSLISTFEXS
-* Create a counter 1 level above the VALUESENTRY segment level in
-* order to determine the array value being returned.
COUNTER/I9 WITH STRINGARRAY=COUNTER + 1;
-* Create a counter at the VALUESENTRY level to sequentially number
-* the complete records coming back.
CTR2/I9 WITH VALUESENTRY=IF COUNTER EQ LAST COUNTER THEN CTR2 + 1 ELSE 1;
END
TABLE FILE WSWF_WEBFOCUSLISTFEXS
-* VALUESENTRY contains the actual data being returned form the WS Function.
SUM VALUESENTRY AS 'FLD'
BY CTR2
ACROSS COUNTER
-* This statement is always required.
WHERE TIME EQ 0 AND DOSIGNON EQ 'true'
-* Designate the application with files to be listed
WHERE APP EQ 'ibisamp'
ON TABLE SET ASNAMES ON AND HOLDLIST PRINTONLY
ON TABLE HOLD
END
-* Now that we've held the file, each column should be uniquely named
-* ie. FLD1 FLD2 FLD3, etc and we can reference individual columns as needed.
TABLE FILE HOLD
PRINT
FLD1 AS 'File Type'
FLD4 AS 'Date'
FLD5 AS 'Time'
FLD6 AS 'Internal Time'
FLD7 AS 'Size in Bytes'
BY FLD3 AS 'File Extension'
BY FLD2 AS 'File Name'
END
 

May 21, 2007, 03:02 PM
sandy28
Thanks so much for responding to this. However, I am consuming a web service that is provided by a different application that is outside of Webfocus. An adapter was created that can successfully connect to the external web service but isn't returning the entire results.

The sample code looks like it is a web service function provided by Webfocus, so unfortunatly, it's not applicable.
September 10, 2007, 12:41 PM
Efrem
If you are consuming a Web Service using the Web Services Adapter, proper metadata is created. So Arrays within Arrays are supported.
The metadata is based on the WSDL file. So if the WSDL file is incorrect, it might only define one Segment in the Master for the Response.