def __call__(self, request, *args, **kwargs):
        try:
            service_request = self.gateway.getServiceRequest(
                request, request.target)
        except gateway.UnknownServiceError:
            return defer.succeed(self.buildErrorResponse(request))

        response = remoting.Response(None)
        deferred_response = defer.Deferred()

        def eb(failure):
            errMesg = "%s: %s" % (failure.type, failure.getErrorMessage())

            if self.gateway.logger:
                self.gateway.logger.error(errMesg)
                self.gateway.logger.info(failure.getTraceback())

            deferred_response.callback(self.buildErrorResponse(
                request, (failure.type, failure.value, failure.tb)))

        def response_cb(result):
            if self.gateway.logger:
                self.gateway.logger.debug("AMF Response: %s" % (result,))

            response.body = result

            deferred_response.callback(response)

        def preprocess_cb(result):
            d = defer.maybeDeferred(self._getBody, request, response,
                service_request, **kwargs)

            d.addCallback(response_cb).addErrback(eb)

        def auth_cb(result):
            if result is not True:
                response.status = remoting.STATUS_ERROR
                response.body = remoting.ErrorFault(code='AuthenticationError',
                    description='Authentication failed')

                deferred_response.callback(response)

                return

            d = defer.maybeDeferred(self.gateway.preprocessRequest,
                service_request, *args, **kwargs)

            d.addCallback(preprocess_cb).addErrback(eb)

        # we have a valid service, now attempt authentication
        d = defer.maybeDeferred(self.authenticateRequest, request,
                                service_request, **kwargs)
        d.addCallback(auth_cb).addErrback(eb)

        return deferred_response
Calls the underlying service method.
dataset/ETHPy150Open AppScale/appscale/AppServer/lib/PyAMF-0.6.1/pyamf/remoting/gateway/twisted.py/AMF0RequestProcessor.__call__