2012-08-23 43 views
0

我在“Standard Python Library by Example”之后实现XMLRPCServer。我希望客户能够看到方法签名,和我预期SimpleXMLRPCServer不支持methodSignature?

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

(客户端代码)会告诉我的方法签名。

但是它返回的“签名不支持”

下面是从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' 

是否有容易的方法,使方法签名? 或SimpleXMLRPCServer真的不支持它们?有支持methodSignatures的实现吗?

很好理解:为什么system_methodSignatures方法包含在服务器不支持它的情况下? XMLRPC规范?

回答