开发者

Sending an array in XMLRPC?

开发者 https://www.devze.com 2023-02-25 18:13 出处:网络
I cant figure out whats wrong with this: $message = new xmlrpcmsg(\'service.RegistrationDetails\', array(new xmlrpcval(

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') ));
0

精彩评论

暂无评论...
验证码 换一张
取 消