lautr.com

Hannes Blog for Development and Stuff besides

zend framework xmlrpc two element structure

| Keine Kommentare

Well, i just had a lot of Fun with xmlrpc two element structure, first the request failed completely – i figured out i had to disable the skip system lookup because the other server couldn’t handle it.

$client = new Zend_XmlRpc_Client('http://www.example.com/xmlrpc.php');
$client->setSkipSystemLookup(true);

Now i had the Problem that zend reduced my request from two levels to one level and so the server couln’t interpret it anymore, for example:

<struct>
<params>
<param><value>
<struct>
<member>
<name>lowerBound</name>
<value><int>18</int></value>
</member>
<member>
<name>upperBound</name>
<value><int>139</int></value>
</member>
</struct>
</value></param>
</params>

became

<params>
<param>
<value><int>18</int></value>
</param>
<param>
<value><int>139</int></value>
</param>
</params>

the Solution is simple, but took my a while, instead of giving him an array like

$response = $client->call('ra.order',array('lowerBound' => 18,'upperBound' => 139));

the array must be wrapped in another array

$response = $client->call('ra.order',array(array('lowerBound' => 18,'upperBound' => 139)));

i wish i knew why… well maybe i don’t…

Autor: Hannes

Hi! I’m Johannes Lauter a 26 year old Web Application Developer based in Berlin ... more

Hinterlasse eine Antwort

Pflichtfelder sind mit * markiert.

*