I see now that such notices are a known issue when running on PHP 5. However, it does suggest that multiple signature support is not perfect! I'll try again when PHPXMLRPC 2.0 is final.

Thanks for your help.


Begin forwarded message:

From: Jeff Tupholme <[EMAIL PROTECTED]>
Date: 10 February 2006 11:39:19pm GMT
To: "<phpxmlrpc@lists.usefulinc.com> <phpxmlrpc@lists.usefulinc.com>" <phpxmlrpc@lists.usefulinc.com>
Subject: Re: [phpxmlrpc] Multiple signatures

Thanks for the help and sorry to be so long in replying!

I've tried calling 'system.methodSignature' with the correct (second, below) form of my method declaration in place, and I get the following back:

&lt;br /&gt;
&lt;b&gt;Notice&lt;/b&gt;: Array to string conversion in &lt;b&gt;xmlrpc.inc&lt;/b&gt; on line &lt;b&gt;507&lt;/b&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;b&gt;Notice&lt;/b&gt;: Array to string conversion in &lt;b&gt;xmlrpc.inc&lt;/b&gt; on line &lt;b&gt;511&lt;/b&gt;&lt;br /&gt;

This of course breaks the response. The same happens if I add my method using add_to_map().

I appreciate I could suppress the error (via reporting levels) to make it work, but I'd rather fix the problem at source. Anyone seen this before, please? I don't see that I have any more arrays than I need!



On 31 Jan 2006, at 9:17am, Gaetano Giunta wrote:

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!



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.

phpxmlrpc mailing list

Reply via email to