本文整理匯總了Python中pysimplesoap.server.SoapDispatcher.list_methods方法的典型用法代碼示例。如果您正苦於以下問題:Python SoapDispatcher.list_methods方法的具體用法?Python SoapDispatcher.list_methods怎麽用?Python SoapDispatcher.list_methods使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pysimplesoap.server.SoapDispatcher
的用法示例。
在下文中一共展示了SoapDispatcher.list_methods方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: SoapDispatcher
# 需要導入模塊: from pysimplesoap.server import SoapDispatcher [as 別名]
# 或者: from pysimplesoap.server.SoapDispatcher import list_methods [as 別名]
dispatcher = SoapDispatcher(
'my_dispatcher',
location = "http://localhost:8080/",
action = 'http://localhost:8080/', # SOAPAction
namespace = "http://example.com/sample.wsdl", prefix="ns0",
trace = True,
ns = True)
# register the user function
dispatcher.register_function('Adder', adder,
returns={'AddResult': int},
args={'a': int,'b': int},
doc = 'Add two values...')
dispatcher.register_function('Multiplier', multiplier,
returns={'MultResult': int},
args={'a': int,'b': int},
doc = 'Multiply two values...')
### Print registered methods
print 'List of Registered methods'
pp.pprint(dispatcher.list_methods(), indent=2, width=1)
### Start the webserver in port 8080
print "Starting server..."
httpd = HTTPServer(("", 8080), SOAPHandler)
httpd.dispatcher = dispatcher
httpd.serve_forever()