Skip to content
Snippets Groups Projects
Commit 79cd055e authored by Elmar Ludwig's avatar Elmar Ludwig
Browse files

convert xmlrpc_dispatcher to new API, re #232

parent b64edf0a
No related branches found
No related tags found
No related merge requests found
...@@ -36,19 +36,21 @@ class Studip_Ws_XmlrpcDispatcher extends Studip_Ws_Dispatcher { ...@@ -36,19 +36,21 @@ class Studip_Ws_XmlrpcDispatcher extends Studip_Ws_Dispatcher {
function dispatch($msg = NULL) { function dispatch($msg = NULL) {
# ensure correct invocation # ensure correct invocation
if (is_null($msg) || !is_a($msg, 'xmlrpcmsg')) if (is_null($msg) || !is_a($msg, 'PhpXmlrpc\Request'))
return $this->throw_exception('functions_parameters_type must not be '. return $this->throw_exception('functions_parameters_type must not be '.
'phpvals.'); 'phpvals.');
$encoder = new PhpXmlRpc\Encoder();
# get decoded parameters # get decoded parameters
$len = $msg->getNumParams(); $len = $msg->getNumParams();
$argument_array = array(); $argument_array = array();
for ($i = 0; $i < $len; ++$i) for ($i = 0; $i < $len; ++$i)
$argument_array[] = php_xmlrpc_decode($msg->getParam($i)); $argument_array[] = $encoder->decode($msg->getParam($i));
# return result # return result
return new xmlrpcresp( return new xmlrpcresp(
php_xmlrpc_encode($this->invoke($msg->method(), $argument_array))); $encoder->encode($this->invoke($msg->method(), $argument_array)));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment