/** * Initialize SOAP Server. * * @return Mage_Webapi_Model_Soap_Server */ protected function _initSoapServer() { $this->_soapServer->initWsdlCache(); $this->_soapServer->setWSDL($this->_soapServer->generateUri(true))->setEncoding($this->_soapServer->getApiCharset())->setSoapVersion(SOAP_1_2)->setClassmap($this->_apiConfig->getTypeToClassMap()); use_soap_error_handler(false); // TODO: Headers are not available at this point. // $this->_soapHandler->setRequestHeaders($this->_getRequestHeaders()); $this->_soapServer->setReturnResponse(true)->setObject($this->_soapHandler); return $this->_soapServer; }
/** * Test Soap server construction with WSDL cache disabling. */ public function testConstructDisableWsdlCache() { /** Mock getConfig method to return false. */ $this->_storeMock->expects($this->any())->method('getConfig')->will($this->returnValue(false)); /** Create Soap server object. */ $server = new Mage_Webapi_Model_Soap_Server($this->_applicationMock, $this->_requestMock, $this->_domDocumentFactory); $server->initWsdlCache(); /** Assert soap wsdl caching option was disabled after soap server initialization. */ $this->assertFalse((bool) ini_get('soap.wsdl_cache_enabled'), 'WSDL caching was not disabled.'); }