1

我有一个简单的代码,当我不在任何代理之后时有效,但在代理之后无效。那么有什么方法可以指定必须通过类http_proxy的构造函数进行连接WSDL.Proxy?我一直在尝试ideone.py

4

1 回答 1

0

您必须将以下补丁应用于ideone.py

diff --git a/ideone.py b/ideone.py
index fffdf27..b15abef 100644
--- a/ideone.py
+++ b/ideone.py
@@ -42,10 +42,10 @@ def getError(response):


 class IdeOne:
-    def __init__(self, user='test', password='test'):
+    def __init__(self, user='test', password='test', **kwargs):
         self._user = user
         self._password = password
-        self._wsdlObject = WSDL.Proxy('http://ideone.com/api/1/service.wsdl')
+        self._wsdlObject = WSDL.Proxy('http://ideone.com/api/1/service.wsdl', **kwargs)

     def testFunction(self):
         response = self._wsdlObject.testFunction(self._user, self._password)

这将允许将关键字参数传递给WSDL.Proxy将用于创建其内部Client.SOAPProxy实例的对象。Client.SOAPProxy有一个http_proxy关键字参数,所以在应用补丁之后,IdeOne(user='test', password='test', http_proxy='the.http.proxy')应该可以工作。

于 2012-10-28T13:12:49.313 回答