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
15
votes
5 answers

Using **kwargs with SimpleXMLRPCServer in python

I have a class that I wish to expose as a remote service using pythons SimpleXMLRPCServer. The server startup looks like this: server = SimpleXMLRPCServer((serverSettings.LISTEN_IP,serverSettings.LISTEN_PORT)) service =…
Staale
  • 27,254
  • 23
  • 66
  • 85
12
votes
1 answer

Python's xmlrpc extremely slow: one second per call

I built an xml-rpc server in Python using SimpleXMLRPCServer, according to the example in the Python documentation. I'm calling it from a Python client on the same machine. The body of the server function executes very fast on its own. But I find…
JimB
  • 971
  • 8
  • 20
9
votes
1 answer

How to see traceback on xmlrpc server, not client?

I have simple xmlrpc server code: from SimpleXMLRPCServer import SimpleXMLRPCServer port = 9999 def func(): print 'Hi!' print x # error! print 'Bye!' if __name__ == '__main__': server = SimpleXMLRPCServer(("localhost", port)) …
Adam
  • 2,254
  • 3
  • 24
  • 42
9
votes
1 answer

python: httplib.CannotSendRequest when nesting threaded SimpleXMLRPCServers

I am intermittently receiving a httplib.CannotSendRequest exception when using a chain of SimpleXMLRPCServers that use the SocketServer.ThreadingMixin. What I mean by 'chain' is the following: I have a client script which uses xmlrpclib to call a…
7
votes
3 answers

Non-valid Unicode/XML with Python SimpleXMLRPCServer?

I am getting the following error on the client side when I pass invalid XML characters to a Python SimpleXMLRPCServer: Fault: :not well-formed (invalid token): line 6, column 15"> Why? Do I have to…
Joseph Turian
  • 15,430
  • 14
  • 47
  • 62
7
votes
2 answers

Shutdown an SimpleXMLRPCServer server in python

Currently I am writing an application using the SimpleXMLRPCServer module in Python. The basic aim of this application is to keep running on a server and keep checking a Queue for any task. If it encounters any new request in the Queue, serve the…
user2617135
  • 73
  • 1
  • 4
6
votes
3 answers

Running SimpleXMLRPCServer in separate thread and shutting down

I have a class that I wish to test via SimpleXMLRPCServer in python. The way I have my unit test set up is that I create a new thread, and start SimpleXMLRPCServer in that. Then I run all the test, and finally shut down. This is my…
Staale
  • 27,254
  • 23
  • 66
  • 85
6
votes
1 answer

how to redirect the logging output of xmlrpc server to some file

I'm using the SimpleXMLRPCServer module to create a rpc server. Whenever i send any request to server it shows me the connection request. How can i redirect this output to some file so that i can see the request made to the server later. this is my…
Hemant
  • 1,313
  • 17
  • 30
4
votes
1 answer

How to fake a soap response in Python?

I am trying to test a function in company product. Our software will make a SOAP request like this: Request Header POST /testfunction.php HTTP/1.1 Accept: application/soap+xml, application/xml, text/xml SOAPAction:…
Zhe Li
  • 1,103
  • 1
  • 14
  • 20
4
votes
4 answers

I want to ignore certificate verification, where and how to do it with XMLRPC web service?

I am accessing a web service and getting this error when trying to connect( web service is XMLRPC and I am using wordpress xmlrpc source code for request and handling repsonse): Error Domain=NSURLErrorDomain Code=-1202 "The certificate for this…
AKG
  • 398
  • 1
  • 5
  • 23
4
votes
1 answer

Having child-processes allow rpc-server to restart while children survive

Scenario I have a rpc-server that needs to spawn important processes (multiprocessing.Process) that last for several days. For security/safety reasons, I don't want these processes survival to depend on the rpc-server. Therfore, I want the server to…
deinonychusaur
  • 7,094
  • 3
  • 30
  • 44
4
votes
3 answers

IP address of client in Python SimpleXMLRPCServer?

I have a SimpleXMLRPCServer server (Python). How can I get the IP address of the client in the request handler? This information appears in the log. However, I am not sure how to access this information from within the request handler.
Joseph Turian
  • 15,430
  • 14
  • 47
  • 62
4
votes
1 answer

xmlrpc response datatype long possible?

Is there any possibility to allow xmlrpc extensions (datatype long int) for the Python simplexmlrpc server? The client uses Apache xmlrpc, which allows 8 byte integers. Basically, I'm using the example code with this function to test it: def…
Daniel
  • 36,610
  • 3
  • 36
  • 69
4
votes
2 answers

Python Multithreading XMLRPC server (?)

Basicly I want to run my xmlrpc server in separate thread or together with my other code, however, after server.serve_forever() there's no way that I can get my another code running after this function. seem server.serve_forever() is running forever…
Sky Explorer
  • 43
  • 1
  • 4
3
votes
2 answers

simpleXMLRPC server python

I have an issue with the simpleXMLRPC server. I have a server in my program which can be reachable from another server. Let's call server the computer which has an instance of simpleXMLServer and client the other server. So when the client connect…
Mr_Kaz
  • 73
  • 1
  • 9
1
2 3 4 5 6