/** * Returns the message response as a PHP array * @param string The unformatted response * @return string A PHP array representation of the method response */ function &returnAsArray($response) { require_once DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_array_parser.php'; $arrayParser = new dom_xmlrpc_array_parser(); if ($arrayParser->parseXML($response, false)) { return $arrayParser->getArrayDocument(); } else { XMLRPC_Client_Exception::raiseException(XMLRPC_CLIENT_MALFORMED_XML_ERR, "Malformed xml returned: \n {$response}"); } }
/** * Parses the method request * @param string The text of the method request * @return mixed The method response document */ function &parseRequest($xmlText) { if ($this->objectAwareness) { require_once DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_object_parser.php'; $parser = new dom_xmlrpc_object_parser($this->objectDefinitionHandler); } else { require_once DOM_XMLRPC_INCLUDE_PATH . 'dom_xmlrpc_array_parser.php'; $parser = new dom_xmlrpc_array_parser(); } if ($parser->parseXML($xmlText, false)) { return $parser->getArrayDocument(); } else { //raise exception, parsing error $this->serverError = DOM_XMLRPC_PARSE_ERROR_NOT_WELL_FORMED; $this->serverErrorString = 'DOM XML-RPC Parse Error - XML document not well formed.'; return null; } }