未找到肥皂水类型:阵列,http://www.w3.org/2001/XMLSchema

2024-09-27 19:26:15 发布

您现在位置:Python中文网/ 问答频道 /正文

我试图迈出第一步,用SUDS、Python创建一个SOAP客户机,但没有成功

WSDL在这里:https://login.keyinvoice.com/API3_ws.php?wsdl

守则:

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

imp = Import("http://schemas.xmlsoap.org/soap/encoding/", location="http://schemas.xmlsoap.org/soap/encoding/")
    
imp.filter.add("http://login.keyinvoice.com/soap/KI_API3")
client = Client("https://login.keyinvoice.com/API3_ws.php?wsdl", doctor=ImportDoctor(imp))

错误:

suds.TypeNotFound: Type not found: '(Array, http://www.w3.org/2001/XMLSchema, )'

我试过了,但没有成功:

然后我尝试了一个节点库,它很简单,但我不能使用它

是WSDL被破坏了吗?导入导入的参数是否不正确?肥皂泡虫

(Python 3.8.2,suds community==0.8.5)

谢谢


Tags: httpsorgcomhttpwswwwloginsoap
1条回答
网友
1楼 · 发布于 2024-09-27 19:26:15

WSDL似乎有两种不同的引用数组的方法。一个是xsd:array,另一个是SOAP-ENC:array

xsd被定义为xmlns:xsd=”http://www.w3.org/2001/XMLSchema“和SOAP-ENC作为xmlns:SOAP-ENC=”http://schemas.xmlsoap.org/soap/encoding/". 我确实在最后一个数组中找到了数组,但在第一个数组中没有找到,但我不是SOAP方面的专家

因此,用SOAP-ENC:Array替换每次出现的xsd:Array在某种程度上解决了这个问题。。我仍然不知道哪里不对:WSDL或SUDS库

相关问题 更多 >

    热门问题