xmlrpclib

S

sashan

Hi

I'm having trouble using xmlrpclib. I register a function (or class)
with the SimpleXMLRPCServer and initiate the server. I then create a
ServerProxy object and connect to the xml-rpc server. When I call a
registerd function or class member function I get the follwoing error.
I've attached the server and client source files.


File "D:\Python23\lib\xmlrpclib.py", line 742, in close
raise Fault(**self._stack[0])
xmlrpclib.Fault: <Fault 1: 'exceptions.TypeError:cannot marshal None
unless allo
w_none is enabled'>

Thanks


from SimpleXMLRPCServer import SimpleXMLRPCServer

class A(object):
def f(self):
print 'A'

def g():
print 'g'

def main():
server = SimpleXMLRPCServer(("",2001))
server.register_function(g)
server.register_instance(A())
server.serve_forever()

if __name__ == '__main__':
main()

from xmlrpclib import ServerProxy

def main():
sp = ServerProxy('http://localhost:2001')
print sp.f()

if __name__ == '__main__':
main()
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top