Beispiel #1
0
    def _genericFailure(self, requester_url, action, message_name,
                        requester_nsa, provider_nsa, correlation_id,
                        connection_id, connection_states, err):

        header_element = helper.createRequesterHeader(
            requester_nsa, provider_nsa, correlation_id=correlation_id)

        active, version, consistent = connection_states[3]
        data_plane_state = nsiconnection.DataPlaneStatusType(
            active, version, consistent)
        connection_states = nsiconnection.ConnectionStatesType(
            connection_states[0], connection_states[1], connection_states[2],
            data_plane_state)

        se = helper.createServiceException(err, provider_nsa)

        failure = nsiconnection.GenericFailedType(connection_id,
                                                  connection_states, se)

        body_element = failure.xml(message_name)

        payload = minisoap.createSoapPayload(body_element, header_element)

        def gotReply(data):
            # for now we just ignore this, as long as we get an okay
            return

        d = httpclient.soapRequest(requester_url,
                                   action,
                                   payload,
                                   ctx_factory=self.ctx_factory)
        d.addCallbacks(gotReply)  #, errReply)
        return d
Beispiel #2
0
    def _createSOAPFault(self, err, provider_nsa, connection_id=None, service_type=None):

        log.msg('Request error: %s. Returning error to remote client.' % err.getErrorMessage(), system=LOG_SYSTEM)

        se = helper.createServiceException(err, provider_nsa, connection_id)
        ex_element = se.xml(nsiconnection.serviceException)

        soap_fault = soapresource.SOAPFault( err.getErrorMessage(), ex_element )
        return soap_fault
Beispiel #3
0
    def _createSOAPFault(self,
                         err,
                         provider_nsa,
                         connection_id=None,
                         service_type=None):

        log.msg('Request error: %s. Returning error to remote client.' %
                err.getErrorMessage(),
                system=LOG_SYSTEM)

        se = helper.createServiceException(err, provider_nsa, connection_id)
        ex_element = se.xml(nsiconnection.serviceException)

        soap_fault = resource.SOAPFault(err.getErrorMessage(), ex_element)
        return soap_fault
Beispiel #4
0
    def _genericFailure(self, requester_url, action, message_name, requester_nsa, provider_nsa, correlation_id,
                        connection_id, connection_states, err):

        header_element = helper.createRequesterHeader(requester_nsa, provider_nsa, correlation_id=correlation_id)

        active, version, consistent = connection_states[3]
        data_plane_state = nsiconnection.DataPlaneStatusType(active, version, consistent)
        connection_states = nsiconnection.ConnectionStatesType(connection_states[0], connection_states[1], connection_states[2], data_plane_state)

        se = helper.createServiceException(err, provider_nsa)

        failure = nsiconnection.GenericFailedType(connection_id, connection_states, se)

        body_element = failure.xml(message_name)

        payload = minisoap.createSoapPayload(body_element, header_element)

        def gotReply(data):
            # for now we just ignore this, as long as we get an okay
            return

        d = httpclient.soapRequest(requester_url, action, payload, ctx_factory=self.ctx_factory)
        d.addCallbacks(gotReply) #, errReply)
        return d