我如何使用python中的wsdl url

问题描述:

我想从WSDL url中使用数据,我不知道我会如何在python中完成这项工作。我如何使用python中的wsdl url

谁能帮助我的例子

这里是WSDL链接以供参考: http://43.242.214.173/cwplservice/cwplonline.svc?wsdl

这里是我曾尝试代码段。

from suds.client import Client 
from suds.xsd.doctor import Import, ImportDoctor 

url = 'http://43.242.214.173/cwplservice/cwplonline.svc?wsdl' 
imp = Import('http://212.235.42.50/WebService/service.php?class=masterPricer', location='https://www.w3.org/2001/XMLSchema.xsd') 
imp.filter.add('http://www.w3.org/2001/XMLSchema') 
client = Client(url, doctor=ImportDoctor(imp)) 
print client 
当我跑我得到下面的错误代码为 suds.TypeNotFound

:类型未找到: '(架构,http://www.w3.org/2001/XMLSchema)'

你有没有看着PySimpleSOAP?我已经使用它,这对于进行SOAP调用和解析小尺寸的XML响应来说非常好。对于非常大的XML消息响应,它已经崩溃了,最终使用xml.etree.ElemenTree编写了自己的XML处理程序。

https://pypi.python.org/pypi/PySimpleSOAP/1.02b