本文整理汇总了PHP中SoapServer::setReturnResponse方法的典型用法代码示例。如果您正苦于以下问题:PHP SoapServer::setReturnResponse方法的具体用法?PHP SoapServer::setReturnResponse怎么用?PHP SoapServer::setReturnResponse使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SoapServer
的用法示例。
在下文中一共展示了SoapServer::setReturnResponse方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _instantiateServer
/**
* Try to instantiate Zend_Soap_Server
* If schema import error is caught, it will retry in 1 second.
*
* @throws Zend_Soap_Server_Exception
*/
protected function _instantiateServer()
{
$apiConfigCharset = Mage::getStoreConfig('api/config/charset');
$wsdlCacheEnabled = (bool) Mage::getStoreConfig('api/config/wsdl_cache_enabled');
if ($wsdlCacheEnabled) {
ini_set('soap.wsdl_cache_enabled', '1');
} else {
ini_set('soap.wsdl_cache_enabled', '0');
}
$tries = 0;
do {
$retry = false;
try {
$this->_soap = new Zend_Soap_Server($this->getWsdlUrl(array("wsdl" => 1)), array('encoding' => $apiConfigCharset));
} catch (SoapFault $e) {
if (false !== strpos($e->getMessage(), "can't import schema from 'http://schemas.xmlsoap.org/soap/encoding/'")) {
$retry = true;
sleep(1);
} else {
throw $e;
}
$tries++;
}
} while ($retry && $tries < 5);
use_soap_error_handler(false);
$this->_soap->setReturnResponse(true)->setClass($this->getHandler());
}