RE: [SOAP] pear::soap array return problem
| From: | Mike Carter | Date: | Wed, 18 Feb 2004 08:55:44 +0000 |
| Subject: | RE: [SOAP] pear::soap array return problem | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1369@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: Mike Evans [mailto:mike@arl.arizona.edu]
> Sent: 17 February 2004 15:34
>
> Sorry, I'm new here and saw that there wasn't archives for
> the group...
> so accept my apologies if this has been covered before.
>
> I'm building a Webservice with PEAR::SOAP and need to be able
> to return
> an unknown number of a particular result. So far I have this
> in my Class:
>
>
> $this->__typedef['{http://lifesci.ibsb.arizona.edu/}publication']
> =
> array('authors' => 'string',
> 'pub_date'=> 'string',
> 'title' => 'string',
> 'source'=> 'string',
> 'volume'=> 'string',
> 'pages'=> 'string'
> );
>
> $this->__dispatch_map['getPubs'] = array('in' =>
> array('netid' =>
> 'string', 'publimit' => 'int'),
> 'out' => array( 'publications' =>
> '{http://lifesci.ibsb.arizona.edu/}publications' ));
>
> The problem is, I'm not sure how many publications will be
> returned from
> the getPubs() method. Any tips on I can handle this?
Would you not handle it like you would with any array of n size? Foreach() ?
While() ?
A problem I encountered is if the returned data is only a single item
sometimes, PEAR::SOAP doesn't seem to build it up on the PHP client side as
an array of size 1. Instead it creates an object from the values.
- Mike C.
________________________________________________________________________
This email has been scanned for all viruses by the MessageLabs Email
Security System. For more information on a proactive email security
service working around the clock, around the globe, visit
http://www.messagelabs.com
________________________________________________________________________