【发布时间】:2009-12-17 15:31:24
【问题描述】:
我有以下代码使用 suds 通过代理发送数据:
import suds
t = suds.transport.http.HttpTransport()
proxy = urllib2.ProxyHandler({'http': 'http://192.168.3.217:3128'})
opener = urllib2.build_opener(proxy)
t.urlopener = opener
ws = suds.client.Client('http://xxxxxxx/web.asmx?WSDL', transport=t)
req = ws.factory.create('ActionRequest.request')
req.SerialNumber = 'asdf'
req.HostName = 'hola'
res = ws.service.ActionRequest(req)
我不知道为什么,但它发送数据的时间可能超过 2 或 3 分钟,甚至更长,并且有时会引发“网关超时”异常。如果我不使用代理,则使用的时间超过 2 秒或更短。这是 SOAP 回复:
(ActionResponse){
Id = None
Action = "Action.None"
Objects = ""
}
代理通过 urllib2 或使用普通的网络浏览器(如 firefox)与其他请求一起运行。
有人知道这里发生了什么泡沫吗?
提前非常感谢!!!
【问题讨论】: