def _method_not_found(self, request, response_obj, method_name): """ Treats the method not found error. """ response = soap.build_soap_error(401) return self._build_response(request, response, response_obj, status=401)
def _build_error(self, failure, request, method_name, response_obj): """ Builds an error based on the failure code. """ e = failure.value status = 500 if isinstance(e, ErrorCode): status = e.status else: failure.printTraceback() response = soap.build_soap_error(status) return self._build_response(request, response, response_obj, status=status)
def _build_error(self, request, response_obj, status): log.error('Building error response') response = soap.build_soap_error(status) response_obj.status = 500 if self.encoding is not None: mime_type = 'text/xml; charset="%s"' % self.encoding else: mime_type = "text/xml" response_obj.headers["Content-type"] = mime_type response_obj.headers["Content-length"] = str(len(response)) response_obj.headers["EXT"] = '' response_obj.body = response return response