title: Python SOAP client, WSDL call with suds gives Transport Error 401 Unauthorized for HTTP basic authentication
body: <h2>Background</h2>
  <p>I'm building a SOAP client with python 2.7.3 and using the suds 0.4.1 library provided by Canonical. The server is using basic authentication over HTTPS.</p>
  <h2>Problem</h2>
  <p>Can't pass authentication on the server, even to get at the WSDL. I get the following error:</p>
  <blockquote>
  <p>suds.transport.TransportError: HTTP Error 401: Unauthorized</p>
  </blockquote>
  <h2>Attempts at resolution and code</h2>
  <p>I have tried both of the authentication methods described in the <a href="https://fedorahosted.org/suds/wiki/Documentation#Basic" rel="noreferrer">suds documentation</a>, but still get the error above at the <code>client = Client(url, ...)</code> line. I've confirmed the credentials and ability to connect in a web browser, which works fine.</p>
  <p>After declaring <code>wsdl_url</code>, <code>username</code> and <code>password</code>, I tried:</p>
  <pre><code>client = Client(url=wsdl_url, username=username, password=password)
  
  # as well as:
  
  t = HttpAuthenticated(username=username, password=password)
  client = Client(url=wsdl_url, transport=t)
  
  # and even:
  
  t = HttpAuthenticated(username=username, password=password)
  t.handler = urllib2.HTTPBasicAuthHandler(t.pm)
  t.urlopener = urllib2.build_opener(t.handler)
  client = Client(url=wsdl_url, transport=t)
  </code></pre>
  <p>That last one seems to, at least, get a response from the WSDL URL in <a href="https://stackoverflow.com/questions/5201037/strange-behavior-from-http-authentication-with-suds-soap-library">another question about HTTP authentication with suds</a>.</p>
  <h2>Other notes</h2>
  <p>This question is distinct from this <a href="https://stackoverflow.com/questions/8697210/python-suds-soap-request-to-https-service-401">similar question</a> because I am using:</p>
  <pre><code>from suds.transport.https import HttpAuthenticated
  # not:
  # from suds.transport.http import HttpAuthenticated
  </code></pre>
  <p>and from the Traceback, the <code>client = Client(url, ...)</code> call clearly hits suds.transport.https.py:</p>
  <pre><code>File &quot;/usr/lib/python2.7/dist-packages/suds/client.py&quot;, line 112, in __init__ self.wsdl = reader.open(url)
  File &quot;/usr/lib/python2.7/dist-packages/suds/reader.py&quot;, line 152, in open d = self.fn(url, self.options)
  File &quot;/usr/lib/python2.7/dist-packages/suds/wsdl.py&quot;, line 136, in __init__ d = reader.open(url)
  File &quot;/usr/lib/python2.7/dist-packages/suds/reader.py&quot;, line 79, in open d = self.download(url)
  File &quot;/usr/lib/python2.7/dist-packages/suds/reader.py&quot;, line 95, in download fp = self.options.transport.open(Request(url))
  File &quot;/usr/lib/python2.7/dist-packages/suds/transport/https.py&quot;, line 60, in open return  HttpTransport.open(self, request)
  File &quot;/usr/lib/python2.7/dist-packages/suds/transport/http.py&quot;, line 64, in open raise TransportError(str(e), e.code, e.fp)
  </code></pre>
  <p>What am I missing?</p>