python3调用webservice接口之多参数传递


from suds.client import Client

 

def func(url, operation, *args):
'''接口调用'''
  client = Client(url)
  result = eval("client.service.%s" % operation)(*args)  #eval将字符串转换成变量使用

  return result

 

url = 'http://10.***.**.***:****/DaiDaiKan/DaiDaiKanService.asmx?wsdl'  #注意地址后面需要加wsdl

operation = 'Prereview'

name = '测试01'
reportId = '100'
reportSn = '2016072500003039963690'
mobile_token = '123'

func(url, operation, str(name), str(reportId), str(reportSn), str(mobile_token))

 

参考博客地址:

http://blog.csdn.net/qq_15013233/article/details/52369656

http://blog.csdn.net/xocom/article/details/64120902


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM