[phpxmlrpc] Multiple signatures

Jeff Tupholme jeff-lists at makemyshow.com
Tue Feb 14 10:13:06 GMT 2006


Thanks. I agree, but $mysig1array and $mysig2array are just regular 
arrays. At the moment I use one of them as my (single) signature, so I 
know it works.

 From a quick look at the code it seems that 'system.methodSignature' 
doesn't (yet) support multiple signatures. That makes it hard to debug 
them!

(Again, I'm working with 1.2.1 and this may already be fixed in 2.0)


Jeff


On 13 Feb 2006, at 11:41pm, Gaetano Giunta wrote:

> BTW:
> the method sig must be an array of arrays, wheter you have only one 
> valid sig or more.
>
> If, in your code,
>
>
>>>>> $xrs = new xmlrpc_server(array(
>>>>> 'examples.myFunc' => array(
>>>>> 'function' => 'foo',
>>>>> 'signature' => array($mysig1array, $mysig2array)
>>>>> )
>>>>> ));
>
> mysigarray1 and mysigarray2 are already both an array of array, I see 
> how this could generate a warning.
>
> maybe
> you could try with:
> 'signature' => array($mysig1array[0], $mysig2array[0])
>
> Bye
> Gaetano
>
>> -----Original Message-----
>> From: phpxmlrpc-bounces at lists.usefulinc.com
>> [mailto:phpxmlrpc-bounces at lists.usefulinc.com]On Behalf Of
>> Jeff Tupholme
>> Sent: Monday, February 13, 2006 7:27 PM
>> To: phpxmlrpc at lists.usefulinc.com
>> Subject: Fwd: [phpxmlrpc] Multiple signatures
>>
>>
>>
>> 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.
>>
>>
>> Jeff
>>
>>
>> Begin forwarded message:
>>
>>> From: Jeff Tupholme <jeff-lists at makemyshow.com>
>>> Date: 10 February 2006 11:39:19pm GMT
>>> To: "<phpxmlrpc at lists.usefulinc.com>
>> <phpxmlrpc at lists.usefulinc.com>"
>>> <phpxmlrpc at 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!
>>>
>>>
>>> Thanks,
>>>
>>> Jeff
>>>
>>>
>>> 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!
>>>>
>>>> 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.



More information about the phpxmlrpc mailing list