Help with suds: HTTP Error 401
plainsane
plainsane at gmail.com
Mon Jun 21 15:11:50 EDT 2010
On Jun 19, 12:16 pm, Sean DiZazzo <half.ital... at gmail.com> wrote:
> On Jun 11, 5:27 am, Eric von Horst <z80vsvi... at hotmail.com> wrote:
>
> > I have small program that tries to open a wsdl. When I execute the
> > program I am getting 'suds.transport.TransportError: HTTP Error 401:
> > Unauthorized'
>
> Hey Eric,
>
> Im a suds noob as well. I found some code that led me to the below
> example. It worked for me when connecting to one particular site. I
> couldnt tell you why though... I guess its worth a shot.
>
> from suds.transport.https import HttpAuthenticated
> import urllib2
>
> t = HttpAuthenticated(username='me', password='password')
> t.handler = urllib2.HTTPBasicAuthHandler(t.pm)
> t.urlopener = urllib2.build_opener(t.handler)
> c = client.Client(url='http://xxx.xxx.xxx.xxx/path/to?
> WSDL',transport=t)
>
> ~Sean
thank you. that helped a lot.
More information about the Python-list
mailing list