Questions tagged [xmlrpclib]

xmlrpclib is the Python standard library module for transparently handling XML Remote Procedure Call. (Available since v2.2)

xmlrpclib is the Python standard library module for handling XML Remote Procedure Call. It has been available since Python 2.2, and is capable of sending the following types of data:

  • Booleans
  • Numbers
  • Strings
  • Arrays
  • Dicts
  • Dates
  • Binary data

The library's main class, ServerProxy, transparently calls its methods across a network, without having to use any special syntax. For example,

proxy = xmlrpclib.ServerProxy("http://www.example.com/rpc-example")
x = proxy.stdev([1,2,3,4,5])

will, behind the scenes, do this:

  1. Transmit a call to the stdev method (along with arguments, changed into XML RPC format) across the network, to the XML RPC server at "http://www.example.com/rpc-example".

  2. The server will read the command respond with the results of the call.

  3. The proxy object will read the results.

  4. The results will be cast from XML RPC format into a native Python object, and returned.

The Python documentation site hosts the xmlrpclib documentation.

149 questions
3
votes
1 answer

How can you adjust xmlrpclib to interpret custom types?

I've been having trouble solving this problem for days, and wasn't able to find any useful resource on this on the internet, so I'll share my findings on this matter for future reference: The Python 2.7 xmlrpclib client has the types defined by the…
nikolas
  • 8,707
  • 9
  • 50
  • 70
3
votes
0 answers

Exiting an SimpleXMLRPCServer application gracefully

I'm trying to make a small application using SimpleXMLRPCServer and I'm wondering how to properly exit it when receiving SIGTERM. The reason is because I will make a start/stop script for the application later and I want it to perform various things…
xit
  • 41
  • 3
3
votes
1 answer

How can I create my custom xmlrpc fault error in python

When using xmlrpclib in python an error on the server side is reported by the client side as an xmlrpclib.Fault. A division by zero error in a method on the server side (using SimpleXMLRPCServer) usually gives an output like the following:…
Alex
  • 41,580
  • 88
  • 260
  • 469
3
votes
1 answer

How to fetch Error Code in XMLRPC library for Android

I have used XMLRPC library for android in my Android Project that uses Magento's API. I am getting an error when I send a request to the Magento Store through using Magneto API. That Error contains "ERROR CODE" with it. The Error is like : …
Haresh Chaudhary
  • 4,390
  • 1
  • 34
  • 57
3
votes
1 answer

PyTest plugin using xmlrpclib fails with IOError: "unsupported XML-RPC protocol" on Mac OS X

When running py.test using a plugin that loads xmlrpclib the test run fails with: INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "/Library/Python/2.7/site-packages/pytest-2.2.4-py2.7.egg/_pytest/main.py", line 70, in…
Eric
  • 636
  • 2
  • 9
  • 23
2
votes
1 answer

How to expose client_address to all methods, using xmlrpclib?

I create little SimpleXMLRPCServer for check ip of client. I try this: Server import xmlrpclib from SimpleXMLRPCServer import SimpleXMLRPCServer server = SimpleXMLRPCServer(("localhost", 8000)) def MyIp(): return "Your ip is: %s" %…
Lauro Oliveira
  • 2,362
  • 1
  • 18
  • 12
2
votes
1 answer

XMLRPC showing -32601 error (using PHP)

I have the following code... "…
Leo
  • 469
  • 1
  • 7
  • 16
2
votes
1 answer

Bad interaction between Zope2 XML-RPC and AT Image mutator?

I am creating a demo for mr.migrator and have run in to an annoying problem, showcased here: # create image proxy = xmlrpclib.ServerProxy(url) # reset data = open('screenshot.png').read() try: proxy.invokeFactory('Image',…
aclark
  • 4,345
  • 1
  • 19
  • 31
2
votes
2 answers

XML-RPC returning value before executing all function code

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…
Adam
  • 2,254
  • 3
  • 24
  • 42
2
votes
1 answer

Odoo xmlrpc TypeError: unhashable type 'list'

I am trying to execute a method on an odoo10 server using the xmlrpclib.ServerProxy. It would load all countries with the name DummyCountry, but only name and id fields. But it throws a TypeError: unhashable type 'list'. The strange thing is, that…
GregorMohorko
  • 2,739
  • 2
  • 22
  • 33
2
votes
1 answer

using special characters in functions: Python

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.…
satran
  • 1,222
  • 4
  • 16
  • 27
2
votes
0 answers

How to add any program in supervisor without restarting it (Supervisor XML-RPC)

I have written a program that adds the config file in the conf.d folder of the supervisor now it is being added but I need to restart the supervisor every time. Here is the code.. import xmlrpclib server =…
Chintan Joshi
  • 149
  • 1
  • 14
2
votes
1 answer

Python: DownloadSubtitle method from opensubtitles api returning blank data

This is one of my first projects in Python and I am encountering this issue. The code: def get_sub(path): server = xmlrpclib.Server(url) token = server.LogIn('', '', 'en', 'OSTestUserAgent')['token'] print server.LogIn('',…
2
votes
1 answer

Python SimpleXMLRPCServer : Socket Error , Connection Refused

I am trying to list the contents of a directory on a server. If the client and server code is executed on the same machine, it works perfectly. However, running the client code from another machine using the IP of the server gives me a Errno…
user3079257
  • 45
  • 2
  • 7
2
votes
1 answer

xmlrpcserver implementation in python capable of registering an entire module?

I have a system where the code sits on a driver accessing a remote system. I'm using the SimpleXmlRpcServer implementation of xmlrpcserver and it works quite well. Functions and instances can be registered, but i dont think entire modules can be…
gangof4
  • 85
  • 7
1 2
3
9 10