xml-rpc

execute promises recursively nodejs

Deadly 提交于 2020-01-03 21:10:45
问题 the following function creates new folder on my server via xmlrpc var createFolder = function(folder_name) { var defer = Q.defer(); client.methodCall('create_folder', [sessionID, folder_name], function(err, resp) { if (err) { if (err.responseString && err.responseString.match('already exist')) { //call the same function recursively with folder_name+Math.round(Math.random()*100) } else { defer.reject(err); } } else { defer.resolve(folder_name); } }); return defer.promise; } The functions

execute promises recursively nodejs

|▌冷眼眸甩不掉的悲伤 提交于 2020-01-03 21:09:33
问题 the following function creates new folder on my server via xmlrpc var createFolder = function(folder_name) { var defer = Q.defer(); client.methodCall('create_folder', [sessionID, folder_name], function(err, resp) { if (err) { if (err.responseString && err.responseString.match('already exist')) { //call the same function recursively with folder_name+Math.round(Math.random()*100) } else { defer.reject(err); } } else { defer.resolve(folder_name); } }); return defer.promise; } The functions

Request user recenttracks from lastfm with codeigniter and xmlrpc

☆樱花仙子☆ 提交于 2020-01-03 05:07:12
问题 I'm trying to get some information from last.fm with Codeigniter. $this->load->library("xmlrpc"); $this->xmlrpc->server("http://ws.audioscrobbler.com/2.0/", 80); $this->xmlrpc->method("user.getrecenttracks"); $request = array("rj", "b25b959554ed76058ac220b7b2e0a026"); $this->xmlrpc->request($request); if(!$this->xmlrpc->send_request()) { echo $this->xmlrpc->display_error(); } The only response I always get is: Invalid parameters - Your request is missing a required parameter It tried some

Request user recenttracks from lastfm with codeigniter and xmlrpc

时光怂恿深爱的人放手 提交于 2020-01-03 05:07:04
问题 I'm trying to get some information from last.fm with Codeigniter. $this->load->library("xmlrpc"); $this->xmlrpc->server("http://ws.audioscrobbler.com/2.0/", 80); $this->xmlrpc->method("user.getrecenttracks"); $request = array("rj", "b25b959554ed76058ac220b7b2e0a026"); $this->xmlrpc->request($request); if(!$this->xmlrpc->send_request()) { echo $this->xmlrpc->display_error(); } The only response I always get is: Invalid parameters - Your request is missing a required parameter It tried some

Web service: RPC vs. RESTful = CISC vs. RISC?

人盡茶涼 提交于 2020-01-03 02:50:08
问题 I read some discussions about RPC style and RESTful web services. So far I have the following 2 thoughts: The argue between RPC and REST seems kind of similar to the argue between CISC and RISC instruction architecture. RPC looks forward to using a more complex vocabulary while REST just use a few common verbs. The REST style just introduce the HTTP protocol as the middle-layer between client and server in the hope to decouple the 2 parties. Just like David Wheeler said: All problems in

XML-RPC returning value before executing all function code

风格不统一 提交于 2020-01-02 15:28:49
问题 I have XML-RPC server: import time import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer class Worker(object): def start_work(self): # is it possible do return value to client here? self.do_work() return 'we started!' def do_work(self): while(True): print 'I\'m doing work...' time.sleep(3) if __name__ == '__main__': port = 8080 server = SimpleXMLRPCServer(("localhost", port)) print "Listening on port %s..." % port w = Worker() server.register_function(w.start_work) while(1):

XML-RPC returning value before executing all function code

浪尽此生 提交于 2020-01-02 15:28:25
问题 I have XML-RPC server: import time import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer class Worker(object): def start_work(self): # is it possible do return value to client here? self.do_work() return 'we started!' def do_work(self): while(True): print 'I\'m doing work...' time.sleep(3) if __name__ == '__main__': port = 8080 server = SimpleXMLRPCServer(("localhost", port)) print "Listening on port %s..." % port w = Worker() server.register_function(w.start_work) while(1):

XML-RPC returning value before executing all function code

旧街凉风 提交于 2020-01-02 15:28:20
问题 I have XML-RPC server: import time import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer class Worker(object): def start_work(self): # is it possible do return value to client here? self.do_work() return 'we started!' def do_work(self): while(True): print 'I\'m doing work...' time.sleep(3) if __name__ == '__main__': port = 8080 server = SimpleXMLRPCServer(("localhost", port)) print "Listening on port %s..." % port w = Worker() server.register_function(w.start_work) while(1):

XML-RPC returning value before executing all function code

做~自己de王妃 提交于 2020-01-02 15:28:02
问题 I have XML-RPC server: import time import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer class Worker(object): def start_work(self): # is it possible do return value to client here? self.do_work() return 'we started!' def do_work(self): while(True): print 'I\'m doing work...' time.sleep(3) if __name__ == '__main__': port = 8080 server = SimpleXMLRPCServer(("localhost", port)) print "Listening on port %s..." % port w = Worker() server.register_function(w.start_work) while(1):

How do we handle Python xmlrpclib Connection Refused?

心已入冬 提交于 2020-01-02 05:08:08
问题 I don't know what the heck I'm doing wrong here, I wrote have an RPC client trying to connect to a non-existent server, and I'm trying to handle the exception that is thrown, but no matter what I try I can't figure out how I'm supposed to handle this: def _get_rpc(): try: a = ServerProxy('http://dd:LNXFhcZnYshy5mKyOFfy@127.0.0.1:9001') a = a.supervisor return a except: return False rpc = _get_rpc() if not rpc: print "No RPC" Since there is no server running, I would expect the output to be