Search Results

Search found 14 results on 1 pages for 'xmlrpclib'.

Page 1/1 | 1 

  • What could cause xmlrpclib.ResponseError: ResponseError() ?

    - by Tom
    Hi, I am experimenting with XML-RPC. I have the following server script (python): from SimpleXMLRPCServer import SimpleXMLRPCServer server = SimpleXMLRPCServer(('localhost', 9000)) def return_input(someinput): return someinput server.register_function(return_input) try: print 'ctrl-c to stop server' server.serve_forever() except KeyboardInterrupt: print 'stopping' and the following client script: import xmlrpclib server = xmlrpclib.ServerProxy('http://www.example.com/pathto/xmlrpcTester2.py') print server.return_input('some input') I have tested this locally and it works fine. All it does it spit out the input fron the client script, which is right. However, when I try to do it on a remote server I get the following error: Traceback (most recent call last): File "client.py", line 4, in <module> print server.return_input('some input') File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1199, in __call__ return self.__send(self.__name, args) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1489, in __request verbose=self.__verbose File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1253, in request return self._parse_response(h.getfile(), sock) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 1392, in _parse_response return u.close() File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/xmlrpclib.py", line 836, in close raise ResponseError() xmlrpclib.ResponseError: ResponseError() Any ideas what could cause this? Thanks in advance for your help.

    Read the article

  • Moses v1.0 multi language ini file

    - by Milan Kocic
    I was working with mosesserver 0.91 and everything works fine but now there is version 1.0 and nothing is same as before. Here is my situation: I want to have multi language translation from arabic to english and from english to arabic. All data and configuration file I have works with 0.91 version of mosesserver. Here is my config file: ------------------------------------------------- ######################### ### MOSES CONFIG FILE ### ######################### # D - decoding path, R - reordering model, L - language model [translation-systems] ar-en D 0 R 0 L 0 en-ar D 1 R 1 L 1 # input factors [input-factors] 0 # mapping steps [mapping] 0 T 0 1 T 1 # translation tables: table type (hierarchical(0), textual (0), binary (1)), source-factors, target-factors, number of scores, file # OLD FORMAT is still handled for back-compatibility # OLD FORMAT translation tables: source-factors, target-factors, number of scores, file # OLD FORMAT a binary table type (1) is assumed [ttable-file] 1 0 0 5 /mnt/models/ar-en/phrase-table/phrase-table 1 0 0 5 /mnt/models/en-ar/phrase-table/phrase-table # no generation models, no generation-file section # language models: type(srilm/irstlm), factors, order, file [lmodel-file] 1 0 5 /mnt/models/ar-en/language-model/en.qblm.mm 1 0 5 /mnt/models/en-ar/language-model/ar.lm.d1.blm.mm # limit on how many phrase translations e for each phrase f are loaded # 0 = all elements loaded [ttable-limit] 20 # distortion (reordering) files [distortion-file] 0-0 wbe-msd-bidirectional-fe-allff 6 /mnt/models/ar-en/reordering-table/reordering-table.wbe-msd-bidirectional-fe.gz 0-0 wbe-msd-bidirectional-fe-allff 6 /mnt/models/en-ar/reordering-model/reordering-table.wbe-msd-bidirectional-fe.gz # distortion (reordering) weight [weight-d] 0.3 0.3 # lexicalised distortion weights [weight-lr] 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 0.3 # language model weights [weight-l] 0.5000 0.5000 # translation model weights [weight-t] 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 0.2 # no generation models, no weight-generation section # word penalty [weight-w] -1 -1 [distortion-limit] 12 --------------------------------------------------------- So please can someone help me and rewrite this config file so it can work in version 1.0. And i need some python sample code of translation. I am using xmlrpc in python and earler I sent http request with: import xmlrpclib client = xmlrpclib.ServerProxy('http://localhost:8080') client.translate({'text': 'some text', 'system': 'en-ar'}) but now seems there is no more 'system' parameter and moses use always default settings.

    Read the article

  • using special characters in functions: Python

    - by satyajit
    I am writing an xmlrpc client which uses a server written in ruby. One of the functions is framework.busy?(). Let me show the ruby version: server.call( "framework.busy?" ) So lets assume I create an instance of the ServerProxy class say server. So while using python to call the function busy? I need to use: server.framework.busy?() This leads to an error: SyntaxError: invalid syntax How can I call this function? Or am I reading the ruby code wrong and implementing it wrongly.

    Read the article

  • Adding nodes to MAAS server

    - by Yasith Tharindu
    I was able to install MAAS server using ubuntu 12.04. Then boot up nodes from he PXE. Then installed maas-precise-x86-64-commissioning through pxe. Now the installation is done. but im unable to commission with the MAAS server. It does not show it as a node and neither im unable to add it manually and end up with following error. Also what is the default username password for maas-precise-x86-64-commissioning. Im unable to login. This error when adding node manually. ERROR 2012-11-20 08:32:54,500 maas.maasserver ################################ Exception: timed out ################################ ERROR 2012-11-20 08:32:54,501 maas.maasserver Traceback (most recent call last): File "/usr/lib/python2.7/dist-packages/django/core/handlers/base.py", line 111, in get_response response = callback(request, *callback_args, **callback_kwargs) File "/usr/lib/python2.7/dist-packages/django/views/decorators/vary.py", line 22, in inner_func response = func(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 166, in call result = self.error_handler(e, request, meth, em_format) File "/usr/lib/python2.7/dist-packages/piston/resource.py", line 164, in call result = meth(request, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/maasserver/api.py", line 251, in dispatcher self, request, request.method, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/maasserver/api.py", line 193, in perform_api_operation return method(handler, request, *args, **kwargs) File "/usr/lib/python2.7/dist-packages/maasserver/api.py", line 493, in new node = create_node(request) File "/usr/lib/python2.7/dist-packages/maasserver/api.py", line 418, in create_node return form.save() File "/usr/lib/python2.7/dist-packages/maasserver/forms.py", line 234, in save node = super(NodeWithMACAddressesForm, self).save() File "/usr/lib/python2.7/dist-packages/django/forms/models.py", line 363, in save fail_message, commit, construct=False) File "/usr/lib/python2.7/dist-packages/django/forms/models.py", line 85, in save_instance instance.save() File "/usr/lib/python2.7/dist-packages/maasserver/models.py", line 114, in save return super(CommonInfo, self).save(*args, **kwargs) File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 460, in save self.save_base(using=using, force_insert=force_insert, force_update=force_update) File "/usr/lib/python2.7/dist-packages/django/db/models/base.py", line 570, in save_base created=(not record_exists), raw=raw, using=using) File "/usr/lib/python2.7/dist-packages/django/dispatch/dispatcher.py", line 172, in send response = receiver(signal=self, sender=sender, **named) File "/usr/lib/python2.7/dist-packages/maasserver/provisioning.py", line 485, in provision_post_save_Node profile, power_type, preseed_data) File "/usr/lib/python2.7/dist-packages/maasserver/provisioning.py", line 245, in call result = self.method(*args) 259,1 93% result = self.method(*args) File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in call return self._send(self._name, args) File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in _request verbose=self._verbose File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request return self.single_request(host, handler, request_body, verbose) File "/usr/lib/python2.7/xmlrpclib.py", line 1294, in single_request response = h.getresponse(buffering=True) File "/usr/lib/python2.7/httplib.py", line 1030, in getresponse response.begin() File "/usr/lib/python2.7/httplib.py", line 407, in begin version, status, reason = self._read_status() File "/usr/lib/python2.7/httplib.py", line 365, in _read_status line = self.fp.readline() File "/usr/lib/python2.7/socket.py", line 447, in readline data = self._sock.recv(self._rbufsize) timeout: timed out

    Read the article

  • Throttle connections to web service if load gets too high?

    - by Joseph Turian
    I have a web site that communicates via XMLRPC with an XMLRPC server web service. (The web service is written in Python using xmlrpclib.) I believe that xmlrpclib will block while it is handling one request. So if there are three users with an xmlrpclib request ahead of you, your response takes four times as long. How do I handle it if I receive too many XMLRPC requests and the web service gets bogged down and has slow response time? If I am getting slashdotted, my preferred behavior is that the first users get good response times and everyone else is told to come back later. I think this is superior to giving everyone terrible response times. How do I create this behavior? Is this called load-balancing? I am not actually balancing though, until I have multiple servers.

    Read the article

  • socket.setdefaulttimeout interacting with M2Crypto connection

    - by Becky
    Hello - I'm making a secure SSL connection to a server using python and M2Crypto. See code below. from M2Crypto import SSL, m2,x509 from M2Crypto.m2xmlrpclib import Server, SSL_Tranport ctx = SSL.Context() m2.ssl_ctx_use_pkey_privkey(ctx.ctx,myKey.pkey) m2.ssl_ctx_use_x509(ctx.ctx,myCert.x509) server = Server(serverUrl, SSL_Transport(ctx)) server.ping() The above works fine. If I try to change the default socket timeout by adding the following two lines at the beginning of the code, I get a protocol error. import socket socket.setdefaulttimeout(40) This is the error I receive: File "/usr/local/lib/python2.4/xmlrpclib.py", line 1096, in call return self._send(self._name, args) File "/usr/local/lib/python2.4/xmlrpclib.py", line 1383, in _request verbose=self._verbose File "/usr/local/lib/python2.4/site-packages/M2Crypto/m2xmlrpclib.py", line 68, in request headers xmlrpclib.ProtocolError: Why is the default socket timeout causing problems?

    Read the article

  • python streaming TCP server with RPC

    - by Noah
    I have written a little streaming mp3 server in python. So far all it does is accept a ServerSocket connection, and begin streaming all mp3 data in its queue to the request using socket.send(). I have implemented this to chunk in stream icy metadata, so the name of the playing song shows up in the client. I would like to add playlist management to the server, so that I can manipulate the playlist of the running server. I have a vague idea that xmlrpclib would be suited to doing this, but I'm confused about one thing: When I start the server it listens on port N. The python xmlrpclib examples involve creating a socket and listening for requests. So my question is should server listen on two ports; i.e., one for streaming client requests and one for xmlrpclib calls, or is there a way to do it by somehow delegating the request to the appropriate handler based on its type?

    Read the article

  • C# Client to Consume Google App Engine RESTful Webservice (rpc XML)

    - by Ngu Soon Hui
    I think I hit a problem when using C# client to consume Google App Engine Webservice. The Google App Engine code I use is here. This is how the python script on server would look like: from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run_wsgi_app import logging from StringIO import StringIO import traceback import xmlrpclib from xmlrpcserver import XmlRpcServer class Application: def __init__(self): pass def getName(self,meta): return 'example' class XMLRpcHandler(webapp.RequestHandler): rpcserver = None def __init__(self): self.rpcserver = XmlRpcServer() app = Application() self.rpcserver.register_class('app',app) def post(self): request = StringIO(self.request.body) request.seek(0) response = StringIO() try: self.rpcserver.execute(request, response, None) except Exception, e: logging.error('Error executing: '+str(e)) for line in traceback.format_exc().split('\n'): logging.error(line) finally: response.seek(0) rstr = response.read() self.response.headers['Content-type'] = 'text/xml' self.response.headers['Content-length'] = "%d"%len(rstr) self.response.out.write(rstr) application = webapp.WSGIApplication( [('/xmlrpc/', XMLRpcHandler)], debug=True) def main(): run_wsgi_app(application) if __name__ == "__main__": main() The client side ( in Python) is this: import xmlrpclib s = xmlrpclib.Server('http://localhost:8080/xmlrpc/') print s.app.getName() I have no problem in using Python client to retrieve values from Google App Engine, but I do have difficulties in using a C# client to retrieve the values. The error I got was 404 method not found when I am trying to GetResponse from the web request. This is my code var request = (HttpWebRequest)WebRequest.Create("http://localhost:8080/xmlrpc/app"); request.Method = "GET"; request.ContentLength = 0; request.ContentType = "text/xml"; using (HttpWebResponse response = request.GetResponse() as HttpWebResponse) //404 method not found error here. { } I think it must be that the url is wrong, but I don't know how to get it right. Any idea?

    Read the article

  • xmlrpc client call in python does not come back

    - by Jack Ha
    Using Python 2.6.4, windows With the following script I want to test a certain xmlrpc server. I call a non-existent function and hope for a traceback with an error. Instead, the function does not return. What could be the cause? import xmlrpclib s = xmlrpclib.Server("http://127.0.0.1:80", verbose=True) s.functioncall() The output is: send: 'POST /RPC2 HTTP/1.0\r\nHost: 127.0.0.1:80\r\nUser-Agent: xmlrpclib.py/1.0 .1 (by www.pythonware.com)\r\nContent-Type: text/xml\r\nContent-Length: 106\r\n\ r\n' send: "<?xml version='1.0'?>\n<methodCall>\n<methodName>functioncall</methodName >\n<params>\n</params>\n</methodCall>\n" reply: 'HTTP/1.1 200 OK\r\n' header: Content-Type: text/xml header: Cache-Control: no-cache header: Content-Length: 376 header: Date: Tue, 30 Mar 2010 13:27:21 GMT body: '<?xml version="1.0"?>\r\n<methodResponse>\r\n<fault>\r\n<value>\r\n<struc t>\r\n<member>\r\n<name>faultCode</name>\r\n<value><i4>1</i4></value>\r\n</membe r>\r\n<member>\r\n<name>faultString</name>\r\n<value><string>PVSS00ctrl (2), 2 010.03.30 15:27:21.395, CTRL, SEVERE, 72, Function not defined, functioncall , , \n</string></value>\r\n</member>\r\n</struct>\r\n</value>\r\n</fault>\r\n</m ethodResponse>\r\n' (here the program hangs and does not return until I kill the server) edit: the server is written in c++, using its own xmlrpc library

    Read the article

  • Connecting to Python XML RPC from the Mac

    - by MAC
    Hi, I wrote an XML RPC server in python and a simple Test Client for it in python. The Server runs on a linux box. I tested it by running the python client on the same linux machine and it works. I then tried to run the python client on a Mac and i get the following error socket.error: (61, 'Connection Refused') I can ping and ssh into the linux machine from the Mac. So i dont think its a configuration or firewall error. Does anyone have any idea what could be going wrong? The code for the client is as below: import xmlrpclib s = xmlrpclib.ServerProxy('http://143.252.249.141:8000') print s.GetUsers() print s.system.listMethods()

    Read the article

  • too many threads due to synch communication

    - by MasoudIzzy
    I'm using threads and xmlrpclib in python at the same time. Periodically, I create a bunch of thread to complete a service on a remote server via xmlrpclib. The problem is that, there are times that the remote server doesn't answer. This causes the thread to wait forever for a response which it never gets. Over time, number of threads in this state increases and will reach the maximum number of allowed threads on the system (I'm using fedora). I tried to use socket.setdefaulttimeout(10); but the exception that is created by that will cause the server to defunct. I used it at server side but it seems that it doesn't work :/ Any idea how can I handle this issue?

    Read the article

  • open-xen-manger configuration error

    - by user113505
    I have installed open xen manager on ubuntu 10.04 for managing XEN running on other machine,but when i add server and click connect through port 80 its showing < ProtocolError for 192.168.2.13:80/RPC2: 404 Not Found also i am getting following in the web server access log of remote machine 192.168.2.8 - - [05/Jun/2012:21:29:32 +0530] "POST /RPC2 HTTP/1.0" 404 483 "-" "xmlrpclib.py/1.0.1 (by www.pythonware.com)" can anyone help me in this

    Read the article

  • What is the current choice for doing RPC in Python?

    - by edomaur
    Actually, I've done some work with Pyro and RPyC, but there is more RPC implementation than these two. Can we make a list of them? Native Python-based protocols: PyRo (Python Remote Objects) RPyC (Remote Python Call) Circuits JSON-RPC based frameworks: python-symmetric-jsonrpc rpcbd XML-RPC based frameworks: XMLRPC, using the xmlrpclib and SimpleXMLRPCServer modules in the standard library. Others? Twisted Spread

    Read the article

  • Easiest way of unit testing C code with Python

    - by Jon Mills
    I've got a pile of C code that I'd like to unit test using Python's unittest library (in Windows), but I'm trying to work out the best way of interfacing the C code so that Python can execute it (and get the results back). Does anybody have any experience in the easiest way to do it? Some ideas include: Wrapping the code as a Python C extension using the Python API Wrap the C code using SWIG Add a DLL wrapper to the C code and load it into Python using ctypes Add a small XML-RPC server to the c-code and call it using xmlrpclib (yes, I know this seems a bit far-out!) Is there a canonical way of doing this? I'm going to be doing this quite a lot, with different C modules, so I'd like to find a way which is least effort.

    Read the article

1