本文整理汇总了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');
}
}