You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Heitzso <he...@bellsouth.net> on 2002/06/20 12:33:09 UTC

Re: Best way of returning multi-dimensional data from an Axis web service method?

The quick and dirty is to return single dim arrays ...
one for column names
one for column types
one that unwraps the rows into a single array

I'm not saying _AT ALL_ that this is the correct
way to do it, just that it works, it's simple,
and every client in the world can read arrays
of strings.

I'ld greatly appreciate knowing the RIGHT way
to do this because it's something I also need to 
do ... i.e. return a table of data ...

On Wed, 2002-06-19 at 16:24, davout wrote:
> I have a situation where a web service methods is supposed to return a page
> of data. The page is normally two dimensional in nature, with a variable
> number of page rows and a variable number of page columns. Something
> like....
> 
>     User Name   Age    Salary   Date of birth
>     ---------   ----   ------   --------------
>      Fred Smith  40     10,000    11/11/90
>      Joe Bloggs  36     21,000    09/09/89
>      Andy Brown  21     10,000    11/11/90
>      Tom Brown   50     10,000    11/11/90
> 
> The number of rows and the column mix can vary from call to call, also on
> ocassion each 'cell' in this 2 dimensional structure can also have its own
> sub properties.
> 
> Currently my web service returns this as a XML DOM Element tree, like...
> 
>    public Element getPage(int aStartRow,
>                           int aMaxEntries,
>                           int[] aResultSetPropIDs);
> 
> In my Java class code I simply build and return a custom DOM Element tree to
> represent this 2 dimensional structure - easy.
> 
> But this causes lots of problems for web service clients, as they have to
> start messing about with alternate encoding style settings to read back the
> XML DOM tree.
> 
> Is there a better mainstream approach to retrieving multi dimensional result
> sets from java based web service methods?  A solution that doesn't require
> any special measures by the client?
> 
>