XMLRPCLIB appears to be broken?

F

flamesrock

Hi,

I'm running xmlrpclib on python 2.4.2.

The problem:
When I pass arguments via xmlrpclib, it passes the args as a list to
the first variable.

Take this example (function should return second of two arguments, but
always returns '')
Here is the php server code:
function createDB($firstparam,$secondparam)
{
return $secondparam;
}



If I change the function to return $firstparam, the first argument, it
returns:
['firstparam', 'secondparam']





So.. why the heck is it doing this???? Clearly it's pythons fault, but
1)why?
2)how do I fix it?

-Thanks in Advance.
 
F

Fredrik Lundh

flamesrock said:
So.. why the heck is it doing this???? Clearly it's pythons fault, but

do you run PHP on a Python emulator ? if not, I completely fail to
see how it can "clearly be Python's fault" that the XML-RPC binding
you're using for PHP don't understand the XML-RPC protocol.
1)why?
2)how do I fix it?

get a working XML-RPC binding for PHP.

</F>
 
F

flamesrock

Thanks for the response.

I'm using IXR_library, which is one of the defato xml-rpc libs out
there. It seems to be working for other people...

The reason I think its a python error is because php doesn't understand
lists, which is what the data is being returned as.
 
F

Fredrik Lundh

flamesrock said:
I'm using IXR_library, which is one of the defato xml-rpc libs out
there. It seems to be working for other people...

The reason I think its a python error is because php doesn't understand
lists, which is what the data is being returned as.

umm. xml-rpc is a platform-neutral transport protocol, so the lists
you're seeing are lists on the python side, "array" elements on the
wire, and arrays on the PHP side [1].

this quote from the IXR documentation might help:

"Note that both of the callback functions accept a single argument -
$args. $args is an array of paramaters received from the XML-RPC
client. If there is only one argument, $args will be that argument
rather than an array with only one element."

guess PHP could need a "not enough arguments" error message...

</F>

1) the library contains the comment /* Nasty function to check if an
array is a struct or not */, and I'm quite sure Simon's not referring to
the fact that it's written in PHP.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,292
Messages
2,571,494
Members
48,171
Latest member
EllaHolmwo

Latest Threads

Top