gpt4 book ai didi

python - 我如何在 python 中使用 wsdl url

转载 作者:太空宇宙 更新时间:2023-11-03 12:04:41 26 4
gpt4 key购买 nike

我想使用来自 WSDL url 的数据,我不知道我在 python 中该怎么做。

谁能帮我举个例子

这是供引用的 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:未找到类型:'(schema, http://www.w3.org/2001/XMLSchema , )'

最佳答案

您是否研究过 PySimpleSOAP?我用过它,它非常适合进行 SOAP 调用和解析小尺寸 XML 响应。对于非常大的 XML 消息响应,它在我身上崩溃了,最终使用 xml.etree.ElemenTree 编写了我自己的 XML 处理程序。

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

关于python - 我如何在 python 中使用 wsdl url,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35869689/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com