예제 #1
0
    def invoke(self, args, kwargs):
        """
        Invoke a specified web service method.

        Depending on how the ``nosend`` & ``retxml`` options are set, may do
        one of the following:
          * Return a constructed web service operation SOAP request without
            sending it to the web service.
          * Invoke the web service operation and return its SOAP reply XML.
          * Invoke the web service operation, process its results and return
            the Python object representing the returned value.

        When returning a SOAP request, the request is wrapped inside a
        RequestContext object allowing the user to acquire a corresponding SOAP
        reply himself and then pass it back to suds for further processing.

        Constructed request data is automatically processed using registered
        plugins and serialized into a byte-string. Exact request XML formatting
        may be affected by the ``prettyxml`` suds option.

        @param args: A list of args for the method invoked.
        @type args: list|tuple
        @param kwargs: Named (keyword) args for the method invoked.
        @type kwargs: dict
        @return: SOAP request, SOAP reply or a web service return value.
        @rtype: L{RequestContext}|I{builtin}|I{subclass of} L{Object}|I{bytes}|
            I{None}

        """
        timer = metrics.Timer()
        timer.start()
        binding = self.method.binding.input
        soapenv = binding.get_message(self.method, args, kwargs)
        timer.stop()
        method_name = self.method.name
        metrics.log.debug("message for '%s' created: %s", method_name, timer)
        timer.start()
        result = self.send(soapenv)
        timer.stop()
        metrics.log.debug("method '%s' invoked: %s", method_name, timer)
        return result
예제 #2
0
    def invoke(self, args, kwargs):
        """
        Invoke a specified web service method.

        Depending on how the ``nosend`` & ``retxml`` options are set, may do
        one of the following:
          * Return a constructed web service operation SOAP request without
            sending it to the web service.
          * Invoke the web service operation and return its SOAP reply XML.
          * Invoke the web service operation, process its results and return
            the Python object representing the returned value.

        When returning a SOAP request, the request is wrapped inside a
        RequestContext object allowing the user to acquire a corresponding SOAP
        reply himself and then pass it back to suds for further processing.

        Constructed request data is automatically processed using registered
        plugins and serialized into a byte-string. Exact request XML formatting
        may be affected by the ``prettyxml`` suds option.

        @param args: A list of args for the method invoked.
        @type args: list|tuple
        @param kwargs: Named (keyword) args for the method invoked.
        @type kwargs: dict
        @return: SOAP request, SOAP reply or a web service return value.
        @rtype: L{RequestContext}|I{builtin}|I{subclass of} L{Object}|I{bytes}|
            I{None}

        """
        timer = metrics.Timer()
        timer.start()
        binding = self.method.binding.input
        soapenv = binding.get_message(self.method, args, kwargs)
        timer.stop()
        method_name = self.method.name
        metrics.log.debug("message for '%s' created: %s", method_name, timer)
        timer.start()
        result = self.send(soapenv)
        timer.stop()
        metrics.log.debug("method '%s' invoked: %s", method_name, timer)
        return result
예제 #3
0
파일: client.py 프로젝트: dilawar/moose-gui
 def invoke(self, args, kwargs):
     """
     Send the required soap message to invoke the specified method
     @param args: A list of args for the method invoked.
     @type args: list
     @param kwargs: Named (keyword) args for the method invoked.
     @type kwargs: dict
     @return: The result of the method invocation.
     @rtype: I{builtin}|I{subclass of} L{Object}
     """
     timer = metrics.Timer()
     timer.start()
     binding = self.method.binding.input
     soapenv = binding.get_message(self.method, args, kwargs)
     timer.stop()
     metrics.log.debug("message for '%s' created: %s", self.method.name, timer)
     timer.start()
     result = self.send(soapenv)
     timer.stop()
     metrics.log.debug("method '%s' invoked: %s", self.method.name, timer)
     return result
예제 #4
0
 def invoke(self, args, kwargs):
     """
     Send the required soap message to invoke the specified method
     @param args: A list of args for the method invoked.
     @type args: list
     @param kwargs: Named (keyword) args for the method invoked.
     @type kwargs: dict
     @return: The result of the method invocation.
     @rtype: I{builtin}|I{subclass of} L{Object}
     """
     timer = metrics.Timer()
     timer.start()
     binding = self.method.binding.input
     soapenv = binding.get_message(self.method, args, kwargs)
     timer.stop()
     metrics.log.debug("message for '%s' created: %s", self.method.name,
                       timer)
     timer.start()
     result = self.send(soapenv)
     timer.stop()
     metrics.log.debug("method '%s' invoked: %s", self.method.name, timer)
     return result