当允许用户在运行时选择方法时,无法在 Suds 中提取方法名称
from suds.client import Client
from suds.transport.https import HttpAuthenticated
import urllib2
class methodinvokeclass():
def methodinvokemethod(self,*args):
method=args[1]
c=args[2]
#method=LatLonListZipCode in the variable above
response=c.service.method("90210")--How should I make this work ?
#response=c.service.LatLonListZipCode("90210")
#The above snippet works, but this not what I want
#As I want to make it generic "method" and ask user in the run time to select --- #methodname
from suds.client import Client
from suds.transport.https import HttpAuthenticated
import urllib2
class methodinvokeclass():
def methodinvokemethod(self,*args):
method=args[1]
c=args[2]
#method=LatLonListZipCode in the variable above
response=c.service.method("90210")--How should I make this work ?
#response=c.service.LatLonListZipCode("90210")
#The above snippet works, but this not what I want
#As I want to make it generic "method" and ask user in the run time to select --- #methodname
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
另外,您还必须进行一些错误检查,以防找不到该方法。
Also, you have to do some error checking in case the method can't be found.