/** * The response received from the method call, response can be retrieved in 3 formats: * - as a PHP varaible, * - as XML string, * - or in the Zend_XmpRpc_Value object * * @param Zend_XmlRpc_Client::RESPONSE_* $type The response value types, options are: * PHP native type, original XML string or Zend_XmlRpc_Value object * @return mixed The response of the service */ public function __getResponse($type = self::RESPONSE_PHP_NATIVE) { if (!$this->_response instanceof Zend_XmlRpc_Value) { throw new Zend_XmlRpc_Client_Exception('Response was not received yet'); } switch ($type) { case self::RESPONSE_PHP_NATIVE: return $this->_response->getValue(); case self::RESPONSE_XML_STRING: return $this->_response->getAsXML(); case self::RESPONSE_ZXMLRPC_OBJECT: return $this->_response; default: throw new Zend_XmlRpc_Client_Exception('Invalid type requested for the response'); } }