Yevgen Yampolskiy
Yevgen Yampolskiy

Reputation: 7198

SimpleXMLRPCServer does not support methodSignature?

I'm implementing XMLRPCServer following "Standard Python Library by Example". I want client to be able to see method signatures, and I expected that

proxy = xmlrpclib.ServerProxy('http://%s:%s' % (host, port))
print proxy.system.methodSignature('list')

(client code) will show me method signature.

However it returns "signatures not supported"

Here is the code from SimpleXMLRPCServer:

def system_methodSignature(self, method_name):
    """system.methodSignature('add') => [double, int, int]

    Returns a list describing the signature of the method. In the
    above example, the add method takes two integers as arguments
    and returns a double result.

    This server does NOT support system.methodSignature."""

    # See http://xmlrpc.usefulinc.com/doc/sysmethodsig.html

    return 'signatures not supported'

Is there an easy way to enable method signatures? or SimpleXMLRPCServer really does not support them? Is there implementation that does support methodSignatures?

Would be good to know: why system_methodSignatures method is included if server does not support it? XMLRPC specs?

Upvotes: 1

Views: 2018

Answers (1)

djc
djc

Reputation: 11711

Register introspection functions.

Read more here: http://www.doughellmann.com/PyMOTW/SimpleXMLRPCServer/#introspection-api

Or see this solution for Django: http://code.google.com/p/django-xmlrpc/wiki/MethodSignatures

Upvotes: 2

Related Questions