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()
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()