/** * Send response to the client, render exceptions if they are present. */ public function sendResponse() { try { if ($this->isException()) { $this->_renderMessages(); } parent::sendResponse(); } catch (Exception $e) { // If the server does not support all MIME types accepted by the client it SHOULD send 406 (not acceptable). $httpCode = $e->getCode() == Mage_Webapi_Exception::HTTP_NOT_ACCEPTABLE ? Mage_Webapi_Exception::HTTP_NOT_ACCEPTABLE : Mage_Webapi_Exception::HTTP_INTERNAL_ERROR; /** If error was encountered during "error rendering" process then use error renderer. */ $this->_errorProcessor->renderException($e, $httpCode); } }
/** * Dispatch request to SOAP endpoint. * * @return Mage_Webapi_Controller_Dispatcher_Soap */ public function dispatch() { try { if ($this->_request->getParam(Mage_Webapi_Model_Soap_Server::REQUEST_PARAM_WSDL) !== null) { $responseBody = $this->_autoDiscover->handle($this->_request->getRequestedResources(), $this->_soapServer->generateUri()); $this->_setResponseContentType('text/xml'); } else { $responseBody = $this->_initSoapServer()->handle(); $this->_setResponseContentType('application/soap+xml'); } $this->_setResponseBody($responseBody); } catch (Exception $e) { $maskedException = $this->_errorProcessor->maskException($e); $this->_processBadRequest($maskedException->getMessage()); } $this->_response->sendResponse(); return $this; }