def do_scgi_xmlrpc_request(host, methodname, params=()): """ Send an xmlrpc request over scgi to host. host: scgi://host:port/path methodname: xmlrpc method name params: tuple of simple python objects returns: xmlrpc response """ xmlreq = xmlrpclib26.dumps(params, methodname) xmlresp = SCGIRequest(host).send(xmlreq) #~ print xmlresp return xmlresp
def __call__(self, *args): #~ print "%s%r"%(self.methodname, args) scheme, netloc, path, query, frag = urlparse.urlsplit(self.url) xmlreq = xmlrpclib26.dumps(args, self.methodname) if scheme == 'scgi': xmlresp = SCGIRequest(self.url).send(xmlreq) return xmlrpclib26.loads(xmlresp)[0][0] #return do_scgi_xmlrpc_request_py(self.url, self.methodname, args) elif scheme == 'http': raise Exception('Unsupported protocol') elif scheme == '': raise Exception('Unsupported protocol') else: raise Exception('Unsupported protocol')