本文整理匯總了PHP中Zend_XmlRpc_Value::getAsXML方法的典型用法代碼示例。如果您正苦於以下問題:PHP Zend_XmlRpc_Value::getAsXML方法的具體用法?PHP Zend_XmlRpc_Value::getAsXML怎麽用?PHP Zend_XmlRpc_Value::getAsXML使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Zend_XmlRpc_Value
的用法示例。
在下文中一共展示了Zend_XmlRpc_Value::getAsXML方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: __getResponse
/**
* 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');
}
}