Returning array of arrays

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
Report Content as Inappropriate

Returning array of arrays

Christoph Boget
I'm testing/working on a webservice method and I'm trying to figure
out how to make it so that it returns data in a particular structure
(specifically, a multi-level array). Currently, my method signature is
defined as returning the following:

@return array of array $SearchResults array of search results

What I'm returning from the method is as follows:

$SearchResults = array( 'ResultsA' => 'joe',
'ResultsB' => 'bob' );

That is working great. I'm getting that as the return value of the
operation in my client as expected. However, the structure I really
would like to return is as follows:

$SearchResults = array( '0' => array( 'ResultsA' => 'joe,
'ResultsB' => 'bob' ),
'1' => array( 'ResultsA' => 'joe',
'ResultsB' => 'bob' ));

And I can't seem to get that to work, no matter how I set up the
method/operation signature w/r/t what is getting returned. What I end
up getting is an array whose elements have the value of "Array".

What am I doing wrong? Is it not possible to return a structure like the above?


Wsf-php-user mailing list
[hidden email]