Questions tagged [simplexmlrpcserver]

The SimpleXMLRPCServer module provides a basic server framework for XML-RPC servers written in Python. Servers can either be free standing, using SimpleXMLRPCServer, or embedded in a CGI environment, using CGIXMLRPCRequestHandler.

This simple server example exposes a single function that takes the name of a directory and returns the contents. The first step is to create the SimpleXMLRPCServer instance and tell it where to listen for incoming requests (‘localhost’ port 9000 in this case)

class SimpleXMLRPCServer.SimpleXMLRPCServer(addr[, requestHandler[, logRequests[, allow_none[, encoding[, bind_and_activate]]]]) Create a new server instance. This class provides methods for registration of functions that can be called by the XML-RPC protocol. The requestHandler parameter should be a factory for request handler instances; it defaults to SimpleXMLRPCRequestHandler. The addr and requestHandler parameters are passed to the SocketServer.TCPServer constructor. If logRequests is true (the default), requests will be logged; setting this parameter to false will turn off logging. The allow_none and encoding parameters are passed on to xmlrpclib and control the XML-RPC responses that will be returned from the server. The bind_and_activate parameter controls whether server_bind() and server_activate() are called immediately by the constructor; it defaults to true. Setting it to false allows code to manipulate the allow_reuse_address class variable before the address is bound.

https://docs.python.org/2/library/simplexmlrpcserver.html

79 questions
3
votes
1 answer

SimpleXMLRPCServer request dispatching issue

We're developing client-server XML-RPC based application. Server part should know IP address of each client on per request basis. To accomplish this we mix SocketServer.ThreadingMixIn into SimpleXMLRPCServer and subclass SimpleXMLRPCRequestHandler…
3
votes
1 answer

Multi-threaded XML-RPC (python3.7.1)

Server: import time import random from threading import Thread …
ebd
  • 157
  • 4
  • 13
3
votes
1 answer

Getting error "cannot marshal None" in spite of adding allow_none=True while using XMLRPC in Python

I've tried to create a simple download and upload system using XMLRPC in Python Here is the code for client (name this file as client.py) import sys import xmlrpclib import os def return_pause(): """Used for creating a pause during input""" …
xavier666
  • 87
  • 12
3
votes
3 answers

Combine SimpleXMLRPCServer and BaseHTTPRequestHandler in Python

Because cross-domain xmlrpc requests are not possible in JavaScript I need to create a Python app which exposes both some HTML through HTTP and an XML-RPC service on the same domain. Creating an HTTP request handler and SimpleXMLRPCServer in python…
TimothyP
  • 21,178
  • 26
  • 94
  • 142
3
votes
1 answer

What could cause xmlrpclib.ResponseError: ResponseError()?

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…
Tom
  • 31
  • 3
3
votes
1 answer

How to make more than one xmlrpc calls to different xmlrpc servers at a time

Is there any way to make multiple calls from an xmlrpc client to different xmlrpc servers at a time. My Server code looks like this: (I'll have this code runnning in two machines, server1 & server2) class TestMethods(object): def…
3
votes
1 answer

Python SimpleXMLRPCServer Server Address(es)

I'm hacking together a simple RPC server in Python for use on internal networks in a laboratory environment. When I create a server with code like: server = SimpleXMLRPCServer(("", 8000)) the server seems to listen on multiple available interfaces…
NF6X
  • 103
  • 1
  • 4
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 to get the output of XMLRPC server (Python 2.7.3)?

I got XMLRPC server/client from python website. When I run simple methods like pow(),add(),div() from Windows, the client gets the result correctly. However, when I run brocade() which gets the configuration information from Brocade switch using…
spark
  • 531
  • 6
  • 17
3
votes
1 answer

Injecting arbitrary code into a Python SimpleXMLRPC Server

In the python docs of python SimpleXMLRPC Server, it is mentioned: Warning Enabling the allow_dotted_names option allows intruders to access your module’s global variables and may allow intruders to execute arbitrary code on your machine. Only use…
Nehal J Wani
  • 16,071
  • 3
  • 64
  • 89
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
0 answers

multithreaded SimpleXMLRPCServer

Can someone give a small example of multi threaded SimpleXMLRPCServer. I tried googling around but none of the thins i found were what i needed. Most tell you to use some other library. I have a simple SimpleXMLRPCServer setup, but i don't know…
Marko Taht
  • 1,448
  • 1
  • 20
  • 40
2
votes
2 answers

SimpleXmlRpcServer _sock.rcv freezes after thousands of requests

I'm serving requests from several XMLRPC clients over WAN. The thing works great for, let's say, a period of one day (sometimes two), then freezes in socket.py: data = self._sock.recv(self._rbufsize) _sock.timeout is -1, _sock.gettimeout is…
Igor Kramaric
  • 173
  • 2
  • 5
2
votes
0 answers

Threaded server locks execution of code

I am working in an environment that creates a Pyramid web service on my localhost. From the setup of this server, I would like to be able to spawn a different thread with a different server that manages queues of requests to the main one, and this…
Luca Giorgi
  • 910
  • 3
  • 14
  • 28
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