本文整理匯總了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());
}