Sending an array in XMLRPC?
I cant figure out whats wrong with this:
$message = new xmlrpcmsg('service.RegistrationDetails',
array(new xmlrpcval(
array('EventId' => new xmlrpxval($EventId, "int"),
'ParticipantId' => new xmlrpxval($usrId, "int")), 'array')
)
);
its as per the documentation on - http://phpxmlrpc.sourceforge.net/doc/xmlrpcval.html
but the above crashes
$result = $server->send($message);
I tried:
$message = new xmlrpcmsg('service.RegistrationDetails',
new xmlrpcval(
array('EventId' => new xmlrpxval($EventId, "int"),
'ParticipantId' => new xmlrpxval($usrId, "int")), 'array')
);
but that didnt work eith开发者_运维问答er
my bad! i had a typo in there - "xmlrpxval" instead of "xmlrpcval". i think the second should work, but not sure...
That's because what you're trying to define is not actually an array, it's an associative array. Use struct
instead of array
and it should work.
This worked perfectly:
$message = new xmlrpcmsg('abc.abcDetails', array(new xmlrpcval($cId, 'int'), new xmlrpcval($dStr,'string') ));
精彩评论