开发者

Invoke an run-time SOAP method via Python/SUDS

开发者 https://www.devze.com 2023-02-13 06:42 出处:网络
I have a suds.client.Client object.I can invoke a method by hardcoding the method name, e.g. myclient = suds.client.Client

I have a suds.client.Client object. I can invoke a method by hardcoding the method name, e.g.

myclient = suds.client.Client
result = myclient.service.some_method(args)

I would like to be able to execute a method whose name is not known until run time. I'm sure this is quite simple, but I'm pretty new to suds and it 开发者_C百科seems to do some pretty crazy magic.

Thanks


result = getattr(myclient.service, 'some_method')(...)
0

精彩评论

暂无评论...
验证码 换一张
取 消