def send(self, target, params): target, category, service = self.parse_target(target) caller = self.choose_caller(target) if caller is None: raise Exception("Cannot connect to %s" % target) req_msg = XmlRequestGenerator(self.configuration, category, service, params) caller.send(target, req_msg.to_xml())
def call(self, target, params, timeout=300, reverse=False): target, category, service = self.parse_target(target) caller = self.choose_caller(target, reverse) if caller is None: raise Exception("Cannot connect to %s" % target) req_msg = XmlRequestGenerator(self.configuration, category, service, params) ret = caller.call(target, req_msg.to_xml(), timeout) resp_parser = XmlResponseParser() return resp_parser.parse(ret)