内网环境下 Suds type not found 的处理办法

2021-03-27 22:17:31 +08:00
 JerryV2

客户在内网环境下有一个 WebService,我使用 suds 访问时,会报错:Type not found:'(schema, http://www.w3.org/2001/XMLSchema.xsd, )'

参考网上的处理办法,使用 doctor 参数:

imp = Import('http://www.w3.org/2001/XMLSchema', location='http://www.w3.org/2001/XMLSchema.xsd')
imp.filter.add('http://tempuri.org/')
doctor = ImportDoctor(imp)
    
client = Client(url, doctor=doctor)      

上一个错误消失了,但是接下来会访问 http://www.w3.org/2001/XMLSchema.xsd , 由于是内网环境,因而连接失败,向万能的 v2er 求助,该如何处理?

在此先谢过了!

1425 次点击
所在节点    Python
1 条回复
JerryV2
2021-04-08 08:43:14 +08:00
改用 zeep 了,很好用

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

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

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

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

© 2021 V2EX