def process_reply(self, reply, status, description):
        """
        Process a web service operation SOAP reply.

        Depending on how the ``retxml`` option is set, may return the SOAP
        reply XML or process it and return the Python object representing the
        returned value.

        @param reply: The SOAP reply envelope.
        @type reply: I{bytes}
        @param status: The HTTP status code (None indicates httplib.OK).
        @type status: int|I{None}
        @param description: Additional status description.
        @type description: str
        @return: The invoked web service operation return value.
        @rtype: I{builtin}|I{subclass of} L{Object}|I{bytes}|I{None}

        """
        if status is None:
            status = httplib.OK
        debug_message = "Reply HTTP status - %d" % (status,)
        if status in (httplib.ACCEPTED, httplib.NO_CONTENT):
            log.debug(debug_message)
            return
        #TODO: Consider whether and how to allow plugins to handle error,
        # httplib.ACCEPTED & httplib.NO_CONTENT replies as well as successful
        # ones.
        if status == httplib.OK:
            log.debug("%s\n%s", debug_message, reply)
        else:
            log.debug("%s - %s\n%s", debug_message, description, reply)

        plugins = PluginContainer(self.options.plugins)
        ctx = plugins.message.received(reply=reply)
        reply = ctx.reply

        # SOAP standard states that SOAP errors must be accompanied by HTTP
        # status code 500 - internal server error:
        #
        # From SOAP 1.1 specification:
        #   In case of a SOAP error while processing the request, the SOAP HTTP
        # server MUST issue an HTTP 500 "Internal Server Error" response and
        # include a SOAP message in the response containing a SOAP Fault
        # element (see section 4.4) indicating the SOAP processing error.
        #
        # From WS-I Basic profile:
        #   An INSTANCE MUST use a "500 Internal Server Error" HTTP status code
        # if the response message is a SOAP Fault.
        replyroot = None
        if status in (httplib.OK, httplib.INTERNAL_SERVER_ERROR):
            replyroot = _parse(reply)
            plugins.message.parsed(reply=replyroot)
            fault = self.__get_fault(replyroot)
            if fault:
                if status != httplib.INTERNAL_SERVER_ERROR:
                    log.warn("Web service reported a SOAP processing fault "
                        "using an unexpected HTTP status code %d. Reporting "
                        "as an internal server error.", status)
                if self.options.faults:
                    raise WebFault(fault, replyroot)
                return httplib.INTERNAL_SERVER_ERROR, fault
        if status != httplib.OK:
            if self.options.faults:
                #TODO: Use a more specific exception class here.
                raise Exception((status, description))
            return status, description

        if self.options.retxml:
            return reply

        result = replyroot and self.method.binding.output.get_reply(
            self.method, replyroot)
        ctx = plugins.message.unmarshalled(reply=result)
        result = ctx.reply
        if self.options.faults:
            return result
        return httplib.OK, result
def process_reply ( self , reply , status , description ) : if status is None : status = httplib . OK debug_message = "Reply HTTP status - %d" % ( status , ) if status in ( httplib . ACCEPTED , httplib . NO_CONTENT ) : log . debug ( debug_message ) return if status == httplib . OK : log . debug ( "%s\n%s" , debug_message , reply ) else : log . debug ( "%s - %s\n%s" , debug_message , description , reply ) plugins = PluginContainer ( self . options . plugins ) ctx = plugins . message . received ( reply = reply ) reply = ctx . reply replyroot = None if status in ( httplib . OK , httplib . INTERNAL_SERVER_ERROR ) : replyroot = _parse ( reply ) plugins . message . parsed ( reply = replyroot ) fault = self . __get_fault ( replyroot ) if fault : if status != httplib . INTERNAL_SERVER_ERROR : log . warn ( "Web service reported a SOAP processing fault " "using an unexpected HTTP status code %d. Reporting " "as an internal server error." , status ) if self . options . faults : raise WebFault ( fault , replyroot ) return httplib . INTERNAL_SERVER_ERROR , fault if status != httplib . OK : if self . options . faults : raise Exception ( ( status , description ) ) return status , description if self . options . retxml : return reply result = replyroot and self . method . binding . output . get_reply ( self . method , replyroot ) ctx = plugins . message . unmarshalled ( reply = result ) result = ctx . reply if self . options . faults : return result return httplib . OK , result
Process a web service operation SOAP reply.

        Depending on how the ``retxml`` option is set, may return the SOAP
        reply XML or process it and return the Python object representing the
        returned value.

        @param reply: The SOAP reply envelope.
        @type reply: I{bytes}
        @param status: The HTTP status code (None indicates httplib.OK).
        @type status: int|I{None}
        @param description: Additional status description.
        @type description: str
        @return: The invoked web service operation return value.
        @rtype: I{builtin}|I{subclass of} L{Object}|I{bytes}|I{None}