xmlrpclib

Discussion in 'Python' started by sashan, Oct 19, 2003.

  1. sashan

    sashan Guest

    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()
    sashan, Oct 19, 2003
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Larry
    Replies:
    0
    Views:
    371
    Larry
    Sep 16, 2003
  2. Brian Quinlan

    RE: xmlrpclib

    Brian Quinlan, Oct 19, 2003, in forum: Python
    Replies:
    0
    Views:
    379
    Brian Quinlan
    Oct 19, 2003
  3. Michael

    mod_python with xmlrpclib

    Michael, Feb 26, 2004, in forum: Python
    Replies:
    0
    Views:
    330
    Michael
    Feb 26, 2004
  4. p2esp

    xmlrpclib timeouts

    p2esp, Mar 2, 2004, in forum: Python
    Replies:
    2
    Views:
    342
    Graham Dumpleton
    Mar 3, 2004
  5. p2esp

    Re: xmlrpclib timeouts

    p2esp, Mar 2, 2004, in forum: Python
    Replies:
    1
    Views:
    342
    Ross M Karchner
    Mar 2, 2004
Loading...

Share This Page