[ciapug] xmlrpc

Dave J. Hala Jr. ciapug@cialug.org
Fri, 29 Apr 2005 16:46:29 -0500


I'm trying pass some parameters to am xmlrpc procedure from a php
client.

I get the following errors:

Warning: reset(): Passed variable is not an array or object in
/usr/share/pear/XML/RPC.php on line 877

Warning: Variable passed to each() is not an array or object in
/usr/share/pear/XML/RPC.php on line 878

Variable $p4 is the problem child.

Here's what the php data structure for $data looks like:
array(2) {
  [0]=>
  array(2) {
    ["ACN"]=>
    string(17) "32-46-033-1892-08"
    ["DEN"]=>
    string(1) "9"

  }
  [1]=>
  array(2) {
    ["ACN"]=>
    string(17) "42-56-133-2892-09"
    ["DEN"]=>
    string(4) "9"

  }
}

I took this data and did the following:

$xml_data = XML_RPC_encode($data);

Then I sent up the parameters array:

# make the parameters for the procedure an array
$p1 = new XML_RPC_Value('user','string');
$p2 = new XML_RPC_Value('password','string');
$p3 = new XML_RPC_Value('agency','string');
$p4 = new XML_RPC_Value($xml_data,'array');
$params = array($p1, $p2,$p3,$p4);

# define the message that calls the procedure we want
# parameters are username,password,data
$message = new XML_RPC_Message('post.notifications', $params);

When it makes the call I get the errors. If I remove $p4 the errors go
away.  Am I doing something wrong when passing in the array?

Can I not pass parameters as array's of arrays?
 

Any thoughts?

:) Dave
-- 

Open Source Information Systems (OSIS)
Dave J. Hala Jr. <dave@osis.us>
641.485.1606