title: Python Webservice Call with Windows Authentication on
body: <p>I am noob at python, but now I have to create a sample python (v2.7) code for my webservice call. It seems working, but when I switched on the "Windows Authentication" on IIS for this webapp, it stopped working. I used SUDS library. Please help to add auth info for calling my webservice. Thanks in advance!</p>
  
  <pre><code>import suds
  import urllib2
  import logging
  from suds.transport.http import HttpAuthenticated
  from suds.client import Client
  
  ##*************************************************************************
  wsdlloc = 'http://myserver.com/myWebService.asmx'
  wsdlurl = wsdlloc+'?wsdl'
  login="test"
  pwd="test123"
  ##*************************************************************************
  if True:
      logging.basicConfig(level=logging.DEBUG)
      logging.getLogger('suds').setLevel(logging.DEBUG)
  ##-------------------
  
  ##--- IT IS WORKING WHEN NO WINDOWS AUTHENTICATION IS NEEDED
  if False:
      c = Client(url=wsdlurl)
      list = c.service.myFunc("2014-05-08","2014-05-28")
      print( list )
  
  ##--- IT GENERATES "suds.transport.TransportError: HTTP Error 401: Unauthorized"
  if True:
      trnsport = suds.transport.http.HttpAuthenticated(username=login, password=pwd)
      client = Client(url=wsdlurl, username=login, password=pwd, transport=trnsport)
      list = client.service.myFunc("2014-05-08","2014-05-28")
      print( list )
  </code></pre>