1

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 either


my bad! i had a typo in there - "xmlrpxval" instead of "xmlrpcval". i think the second should work, but not sure...

siliconpi
  • 8,105
  • 18
  • 69
  • 107

2 Answers2

0

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.

Stephen Melrose
  • 4,772
  • 5
  • 29
  • 42
0

This worked perfectly:

$message = new xmlrpcmsg('abc.abcDetails', array(new xmlrpcval($cId, 'int'), new xmlrpcval($dStr,'string') ));
siliconpi
  • 8,105
  • 18
  • 69
  • 107