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 "Ng, Charles" <Ch...@cognos.com> on 2002/06/19 22:33:30 UTC

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

How about making getPage() a RPC call and return an array of arrays of
cells?  This way the data will be SOAP encoded so Web service clients will
have a better chance in de-serializing them.  However, the wire message
might be a bit bloated.

Charles

-----Original Message-----
From: davout [mailto:davout@dsl.pipex.com]
Sent: Wednesday, June 19, 2002 4:25 PM
To: axis-user@xml.apache.org
Subject: Best way of returning multi-dimensional data from an Axis web
service method?


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?


This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.

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

Posted by davout <da...@dsl.pipex.com>.
I had the same idea of using an array, but with an array you'd have to
duplicate the cell type info in each cell.

My thoughts had been along the lines of a 'DataPage' class that contains sub
objects to control column type info and a list of data cells. But as cells
might have their own set of sub cells - this could get quite intricate.

Can WSDL handle things like recurseive associations, where data cell owns a
set of subordinate data cells?

-----Original Message-----
From: Ng, Charles [mailto:Charles.Ng@cognos.com]
Sent: 19 June 2002 21:34
To: 'axis-user@xml.apache.org'
Subject: RE: Best way of returning multi-dimensional data from an Axis
web service method?


How about making getPage() a RPC call and return an array of arrays of
cells?  This way the data will be SOAP encoded so Web service clients will
have a better chance in de-serializing them.  However, the wire message
might be a bit bloated.

Charles

-----Original Message-----
From: davout [mailto:davout@dsl.pipex.com]
Sent: Wednesday, June 19, 2002 4:25 PM
To: axis-user@xml.apache.org
Subject: Best way of returning multi-dimensional data from an Axis web
service method?


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?


This message may contain privileged and/or confidential information.  If you
have received this e-mail in error or are not the intended recipient, you
may not use, copy, disseminate or distribute it; do not open any
attachments, delete it immediately from your system and notify the sender
promptly by e-mail that you have done so.  Thank you.