Help with suds: HTTP Error 401

E

Eric von Horst

Hi,

I am trying to do a very simple thing with SUDS but I think I am
missing the obvious (first time I use suds)

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' Seems obvious but I specify username and pwd in the
code.
when use IE to go the wsdl, I get a pop-up asking me for the username
and pwd, I enter them, and the wsdl is displayed.

This is my code:
"
from suds import WebFault
from suds.client import Client
from suds.transport.http import HttpAuthenticated


t = HttpAuthenticated(username='admin', password='admin')


client = Client('http://xxxx.xxx.xx.x:8080/axis2/services/UcmdbService?
wsdl', transport=t)
"
I seems straightforward :(

Any help much appreciated.

Erik
 
P

plainsane

Hi,

I am trying to do a very simple thing with SUDS but I think I am
missing the obvious (first time I use suds)

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' Seems obvious but I specify username and pwd in the
code.
when use IE to go the wsdl, I get a pop-up asking me for the username
and pwd, I enter them, and the wsdl is displayed.

This is my code:
"
from suds import WebFault
from suds.client import Client
from suds.transport.http import HttpAuthenticated

t = HttpAuthenticated(username='admin', password='admin')

client = Client('http://xxxx.xxx.xx.x:8080/axis2/services/UcmdbService?
wsdl', transport=t)
"
I seems straightforward :(

Any help much appreciated.

Erik

im having the same issue as well.
 
S

Sean DiZazzo

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
 
P

plainsane

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top