【问题标题】:python suds without internet connection没有互联网连接的python suds
【发布时间】:2014-05-27 07:52:38
【问题描述】:

我正在使用 suds 访问 SOAP 服务器,但它失败了。不幸的是,与此问题相同,建议的解决方法不起作用。 suds failed without internet access

suds 的问题是它试图从互联网上下载 XMLSchema.xsd 没有成功:

DEBUG:suds.xsd.sxbasic:Import:0xb7808a6cL, importing ns="
http://www.w3.org/2001/XMLSchema", location="
http://www.w3.org/2001/XMLSchema.xsd"
DEBUG:suds.transport.http:opening (http://www.w3.org/2001/XMLSchema.xsd)
Traceback (most recent call last):
.....
urllib2.URLError: <urlopen error timed out>

【问题讨论】:

  • 我不记得细节了,但我已经成功地复制了/tmp 中的缓存文件并定期将它们复制回那里。我想我必须手动将缓存文件夹设置为静态路径。不过,您需要一个有效的 Internet 连接才能首先生成缓存文件。
  • 我的观察是超时是可以的,因为没有互联网连接,因为您正在连接一些可以通过互联网访问的资源。

标签: python soap client suds


【解决方案1】:

由于某种原因 Import.bind() 对我不起作用,所以我进入了 suds 源代码并做了一些摆弄。 转到 /suds/transport/http.py。 将以下内容添加到 HttpTransport 类中的 open 方法中。

if url == "http://www.w3.org/2005/05/xmlmime": url = 'file:///SOAP_Schemas/2005.xml'

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2016-02-11
    • 2012-12-24
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多