RE: Multiple signatures
"Gaetano Giunta" <[email protected]> Tue, 31 Jan 2006 10:17:04 +0100
| Newsgroups | gmane.comp.php.xml-rpc |
|---|---|
| Message-ID | <[email protected]> |
The first example is wrong, by virtue of php syntax: you are declaring twice the value of the 'signature' member of the array. The second declaration wins, and the only valid signature you get is $mysig2array. The second declaration looks ok to me. Are you sure that you are not mixing up the $mysig1array and $mysig2array arrays or omitting the return type as first value of $mysig1array and $mysig2array? Your best bet is to call a system.listmethods on your server, and see what it declares to expose. If you upgrade to version 2.0 of the lib, you will get for free a debugger (same interface as you get on http://gggeek.damacom.it/debugger ) that will do the job for you, and show results of the system.listmethods call in a nicely formatted table - very useful for introspection! Bye Gaetano >Hi, > >I'm trying to create a method with multiple signatures and having >problems. I've tried both the following formats (for illustration, I >actually have four variants): > >$xrs = new xmlrpc_server(array( > 'examples.myFunc' => array( > 'function' => 'foo', > 'signature' => $mysig1array, > 'signature' => $mysig2array > ) >)); > >$xrs = new xmlrpc_server(array( > 'examples.myFunc' => array( > 'function' => 'foo', > 'signature' => array($mysig1array, $mysig2array) > ) >)); > >I can confirm the signature arrays themselves are OK by using them >one at a time. When I combine them in the first form I get an error >similar to: > >>Incorrect parameters passed to method: Wanted array, got string at >>param 2 > >... as it seems to get the various signatures confused. The second >form yields: > >>Incorrect parameters passed to method: No method signature matches >>number of parameters > >I'm using PHPXMLRPC 1.2.1 with PHP 5.1.1. > >Thanks in anticipation of any helpful suggestions. > > >Regards, > >Jeff > >_______________________________________________ >phpxmlrpc mailing list >[email protected] >http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc _______________________________________________ phpxmlrpc mailing list [email protected] http://lists.usefulinc.com/cgi-bin/mailman/listinfo/phpxmlrpc