2016-03-08 53 views
4

我想從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)'

回答

0

你有沒有看着PySimpleSOAP?我已經使用它,這對於進行SOAP調用和解析小尺寸的XML響應來說非常好。對於非常大的XML消息響應,它已經崩潰了,最終使用xml.etree.ElemenTree編寫了自己的XML處理程序。

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