Re: [SOAP] [pear::soap - wsdl] Dispatch map for returning arrays (newbie)
| From: | Chris Coe | Date: | Mon, 08 Sep 2003 17:45:31 +0000 |
| Subject: | Re: [SOAP] [pear::soap - wsdl] Dispatch map for returning arrays (newbie) | ||
| References: | 1 | Groups: | php.soap |
| Request: | Send a blank email to php-soap+get-1033@lists.php.net to get a copy of this message | ||
At 20:03 07/09/2003, Luis Ferrao wrote:
Hi,
This is a very simple question.
Let's say i want to creat a function (say testDB) that returns arrays (i.e.
0 => zero, 1 => one, 2 => two, etc...) of unkown variable size. What should
my dispatch map look like ?
PHP:____________________________________________________
$this->__dispatch_map['testDB'] =
array('in' => array('inputStringSimple' => 'string'),
'out' => array(' ???? => ???? '),
);
________________________________________________________
Although there may be a less convoluted way, you could define a type
which represents arrays of strings (or whatever your output elements are),
and refer to this type in your dispatch map:
define('MY_NS', '{http://foo.bar}');
$this->__typedef[MY_NS.'ArrayOfString'] = array(array('item' => 'string'));
$this->__dispatch_map['testDB'] =
array('in' => array('inputStringSimple' => 'string'),
'out' => array('databaseOutput' => MY_NS.'ArrayOfString'));
Since you have to specify a type name in the dispatch_map in/out values,
and no 'array of string' type exists by default, you have to define one.
ps: if someone can at least point me to some dispatch map examples it would be great.If you need a specific example, just ask :-) Hope that helps. Best, Chris.