Web 服务通信期间 URLOpen 错误
我必须开发一个通过 python 与 Web 服务通信的应用程序。由于某些原因,我必须在 Windows 服务器计算机上运行此代码(我对此没有太多经验,通常我们使用基于 uint 的系统)。
由于一些沟通问题,我与 api 提供者的沟通不是直接的。因此,我必须将我的问题邮寄给另一个人,然后他用母语将我的消息通过电子邮件发送给他们,因此我无法从提供商那里获得太多支持。
我的问题是,我使用 suds
作为 Web 服务客户端。 Cleint 似乎成功从服务器获取 WSDL 定义,如下所示:
from suds.client import Client
class SomeClass(Client):
def __init__(self):
Client.__init__(url)
def myFunc():
f = SomeClass()
print f
服务(运输)tns="..."
前缀 (1) ns0 = ....
端口 (2): (运输肥皂) 方法 (4) 获取余额()
...
所以我可以看到 suds
可以到达目标 Web 服务并获取 WSDL 文件。但是,当我调用如下方法时:
def myFunc():
f = SomeClass()
f.GetBalance()
Urllib2.URLError <urlopen error [Errno 10060] A connection attempt
failed because the connected party did not properly respond after a
period of time, or established connection failed because connected
host has failed to respond>
我看不出出了什么问题?
I had to developed an application which will communicate with a Web service via python. I have to run this code on a Windows server machine for some reasons (which i am not much experianced with, notmally we use uint based systems).
My communication with the api provider is not directly because of some communication issies. So i have to mail my problems to another person and he email them my message in the native language, so i could not get much support from the provider because of that.
My problem is, i use suds
for web service client. Cleint semmed to succeed to get WSDL definition from the serveer like:
from suds.client import Client
class SomeClass(Client):
def __init__(self):
Client.__init__(url)
def myFunc():
f = SomeClass()
print f
Service ( transport ) tns="..."
Prefixes (1) ns0 = ....
Ports (2): (TransportSoap) Methods (4) GetBalance()
...
So i can see that suds
can reach target web service and get the WSDL file. However when i call a method like:
def myFunc():
f = SomeClass()
f.GetBalance()
Urllib2.URLError <urlopen error [Errno 10060] A connection attempt
failed because the connected party did not properly respond after a
period of time, or established connection failed because connected
host has failed to respond>
I could not see what is wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
经过一番基于
urlopen 错误 [Errno 10060]
的搜索后,我决定尝试代理使用,结果证明这是解决方案!如果 WSDL url 是
然后使用:
绝对解决了问题...
After some search based on
urlopen error [Errno 10060]
, i decided to try proxy usage and it turns out to be the solution!If WSDL url is
then using:
definitely solves the problem...