プロキシの背後にいない場合は機能するが、プロキシの背後にいる場合は機能しない単純なコードがあります。では、クラスhttp_proxy
のコンストラクターでを介して接続を確立する必要があることを指定する方法はありますか?WSDL.Proxy
私はideone.pyを試してきました。
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 に答える