2012-08-23 44 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規範?

回答