Commit 638f751a authored by jun's avatar jun Committed by Dan Poltawski
Browse files

MDL-52209 webservice_xmlrpc: Remove Zend from webservice_xmlrpc

Additional fixes.
parent 8573e526
......@@ -3,6 +3,13 @@ information provided here is intended especially for developers.
This information is intended for authors of webservices, not people writing webservice clients.
=== 3.1 ===
* Zend_XmlRpc has been dropped from webservice_xmlrpc. Fault strings that were generated by
Zend_XmlRpc_XXX_Exception exceptions (i.e. 'Method "[methodname]" does not exist') are no longer used
which may display a different error message depending on the string returned by the getMessage()
method of the thrown exception.
=== 3.0 ===
* WS protocols webservice/myprotocol:use capabilities were defined with a high riskbitmask value
......
......@@ -95,7 +95,7 @@ class webservice_xmlrpc_client {
// Decode the response.
$result = xmlrpc_decode($response);
if (is_array($result) && xmlrpc_is_fault($result)) {
throw new moodle_exception($result['faultString']);
throw new Exception($result['faultString'], $result['faultCode']);
}
return $result;
......
......@@ -103,7 +103,8 @@ class webservice_xmlrpc_server extends webservice_base_server {
if (!empty($this->function->returns_desc)) {
$validatedvalues = external_api::clean_returnvalue($this->function->returns_desc, $this->returns);
$encodingoptions = array(
"encoding" => "utf-8"
"encoding" => "utf-8",
"verbosity" => "no_white_space"
);
// We can now convert the response to the requested XML-RPC format.
$this->response = xmlrpc_encode_request(null, $validatedvalues, $encodingoptions);
......@@ -186,7 +187,8 @@ class webservice_xmlrpc_server extends webservice_base_server {
);
$encodingoptions = array(
"encoding" => "utf-8"
"encoding" => "utf-8",
"verbosity" => "no_white_space"
);
return xmlrpc_encode_request(null, $fault, $encodingoptions);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment