Programmatically invoke RPC methods for a SOAP endpoint in python

假装没事ソ 提交于 2019-12-03 07:33:07
mvantellingen

You can give python-zeep a chance (http://docs.python-zeep.org). It can easily generate the xml which you want to send via the following code:

client = zeep.Client(
    wsdl='http://www.webservicex.net/ConvertSpeed.asmx?WSDL')
doc = client.service._binding.create_message('ConvertSpeed', 100, 
      'kilometersPerhour', 'milesPerhour'))    
print(etree.tostring(doc, pretty_print=True))

(I'm the author so let me know if you have any issues with this)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!