On 23Jan2010 18:01, I wrote:
| I'm porting a small web service app from ZSI to suds.
| I'm having trouble connecting to an https:// service URL
| via a proxy.
[...]
| I'm using suds-0.3.8 and python-2.6.4; the former because it is current
| and the latter because it contains https-via-proxy support in urllib2.
|
| The setup code looks like this:
|
| client = Client(wsdlURL)
| if os.environ.get('WEBPROXY'):
| proxy = { 'http': os.environ['WEBPROXY'],
| 'https': os.environ['WEBPROXY'],
| }
| print "proxy =", `proxy`
| sys.stdout.flush()
| client.set_options(proxy = proxy)
| client.set_options(location = 'https://localhost/foo-service')
[...]
Just to note that if I set the UNIX environment variable https_proxy
and don't use the suds proxy set_options() at all, things work just
fine because python-2.6.4's urllib/urllib2 modules quietly do the right
thing for this.
This will suffice for my intended use, but I'd like to know what the
state of play is for using suds to control this, eg for when the envvar
is not appropriate or when some specific calls must go via a specific
proxy.
Cheers,
--
Cameron Simpson <cs(a)zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/
Make it idiot proof and someone will make a better idiot.