XML-RPC Question

Thomas Weholt thomas at gatsoft.no
Thu Mar 14 07:55:07 EST 2002


I'm not sure about this, but I think SimpleXMLRPCServer only provide access
to the methods of the object you "publish", in your example the methods of
MyClass, nothing else.

system.listMethods() comes from .... .NET ??

I migth be wrong, and if so, please let me know.

Thomas

"Jesper Olsen" <jolsen at mailme.dk> wrote in message
news:cf0ad9fb.0203140407.2356290b at posting.google.com...
> Has anyone used the SimpleXMLRPCServer class?
>
> Setting up a server goes something like this:
>
>     from SimpleXMLRPCServer import *
>
>     class MyClass:
>         def helloWorld(self):
>             return "Hello World!"
>
>         def echo(self, text):
>             return text
>
>     myob=MyClass()
>
>     server=SimpleXMLRPCServer(("",50000))
>     server.register_function(myob.helloWorld)
>     server.serve_forever()
>
> The server can now be accessed by a client, e.g.:
>
>     import xmlrpclib
>
>     srv=xmlrpclib.Server("http://localhost:50000")
>
>     try:
>         print srv.helloWorld()
>         print srv.system.listMethods()
>     except xmlrpclib.Error, v:
>         print "Error", v
>
> The first srv.helloWorld() call succeeds, but srv.system.listMethods()
results
> in a "Fault 1" exception "system.listMethods" is not supported...
>
> Is there something wrong here, or does SimpleXMLRPCServer, not support
> the listMethods() call?
>
> Cheers
> Jesper





More information about the Python-list mailing list