Python soap client 使用 suds 错误:suds.TypeNotFound: Type not found: 'faultcode',如何修复

2020-01-08 18:40:12 +08:00
 liwenbest

请教各位大佬,使用 suds 请求 wdsl 接口数据时候, import suds from xml.sax.saxutils import escape from suds.client import Client

Schema:0x7f075b7e6c18 (raw) <xsd:schema attributeFormDefault="unqualified" elementFormDefault="unqualified" targetNamespace="http://ws.webservice.les.com/"> <xsd:element name="Exception" type="tns:Exception"/> <xsd:complexType name="Exception"> xsd:sequence <xsd:element minOccurs="0" name="message" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema> (model) <Element:0x7f075b7e6c50 name="Exception" type="('Exception', 'http://ws.webservice.les.com/')" /> <Complex:0x7f075b7e6c88 name="Exception"> Sequence:0x7f075b7e6cf8 <Element:0x7f075b7e6d68 name="message" type="('string', 'http://www.w3.org/2001/XMLSchema')" />

<suds.sax.document.Document object at 0x7f075b7f2f60> Traceback (most recent call last): File "hn_wdsl.py", line 145, in <module> a.get_lyts() File "hn_wdsl.py", line 49, in get_lyts result = client.service.queryLyts(startRow =0, pageSize=10,status='已办结',tsDate ='2018-01-01') File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/client.py", line 521, in call File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/client.py", line 581, in invoke File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/client.py", line 621, in send File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/client.py", line 685, in process_reply File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/bindings/binding.py", line 147, in get_reply File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/umx/typed.py", line 66, in process File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/umx/core.py", line 46, in process File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/umx/core.py", line 61, in append File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/umx/core.py", line 138, in append_children File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/umx/core.py", line 59, in append File "/root/anaconda3/lib/python3.6/site-packages/suds_jurko-0.6-py3.6.egg/suds/umx/typed.py", line 80, in start suds.TypeNotFound: Type not found: 'faultcode'</module>

出现这个问题 如何解决

2301 次点击
所在节点    Python
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/636249

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX