This is my first experience of SOAP and suds and help will be appreciated.
According to the suds documentation the way to set the proxy is:
d = dict(http='host:80', https='host:443', ...) client.set_options(proxy=d)
My question is how it is possible to do that if the invoking of the object 'client' requires an url and needs the proxy to reach the url?
In the following code I tried to overcome this problem but without success: The proxy setting gets ignored and the process ends with a SYN_SENT and timeout: ============================================================= import sys # sys.path.append('../')
import logging import traceback as tb import suds.metrics as metrics from suds import WebFault from suds.client import Client from suds.transport.http import HttpAuthenticated p = dict(http ='http://proxy.sun.ac.za:3128', https ='https://proxy.sun.ac.za:3128')
url = 'http://search.isiknowledge.com/esti/wokmws/ws/WOKMWSAuthenticate?wsdl' t = HttpAuthenticated() import os proxyOpts = dict() if os.environ.has_key('http_proxy'): proxyOpts['http'] = os.environ['http_proxy'].replace('http://', '') elif os.environ.has_key('HTTP_PROXY'): proxyOpts['http'] = os.environ['HTTP_PROXY'].replace('http://', '') else: proxyOpts['http'] = 'proxy.sun.ac.za:3128'
client = Client(url, proxy = proxyOpts, transport = t, username='x', password='y') # Configure HTTP proxy from OS environment (e.g. http_proxy="http://proxy.example.com:8080") ==============================================
So how do I procede from here?
Regards Johann