[phpxmlrpc] Decode a struct in a server method
Simon Jansson
info@byteanha.ms
Mon, 04 Nov 2002 15:17:49 +0100
Dear list,
after reading the book Xml-Rpc I'm trying to do some coding by myself but
I'm having trouble decoding an incoming struct in a server method.
This is the message I send to the server (ok):
<?xml version="1.0"?>
<methodCall>
<methodName>register</methodName>
<params>
<param>
<value><struct>
<member><name>one</name>
<value><string>ones_value</string></value>
</member>
<member><name>two</name>
<value><string>twos_value</string></value>
</member>
</struct></value>
</param>
</params>
</methodCall>
This is the message I receive (ok):
<?xml version="1.0"?>
<!-- DEBUG INFO:
Object
-->
<methodResponse>
<params>
<param>
<value><i4>1</i4></value>
</param>
</params>
</methodResponse>
But when I try to decode the struct in the server method "register". With
the following code:
<?PHP...etc...
function register( $xmlrpcMessage ){
$values = xmlrpc_decode($xmlrpcMessage);
xmlrpc_debugmsg($xmlrpcMessage);
...etc...?>
I get the following error: Call to undefined function: kindof() in line
1021 (xmlrpc.php). It seems that xmlrpcMessage is not a valid object?
When I use the xmlrpc_debugmsg() on the incoming variable I get object as
response (as listed above) which is correct I guess(?). When doing a little
test on the object with a loop I get the following result:
payload
methodname register
params Array
debug 0
I guess I'm doing something really basic error here but I can't figure out
what? Any help or advice is highly appreciated!
Best regards
Simon