Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Can't get around HTTP/401 response using SUDS

Reply
Thread Tools

Can't get around HTTP/401 response using SUDS

 
 
Adam Tauno Williams
Guest
Posts: n/a
 
      03-08-2012
SUDS version 0.4 pn x86_64 Python 2.7

I'm having a bear of a time getting HTTP Basic Authentication to work
for a SOAP request via suds. Also using an HTTP proxy server.

In WireShark I just see a request -
GET http://...../services/services/JobService-0.0.1?wsdl HTTP/1.1
Accept-Encoding: identity
Host: .......
Connection: close
User-Agent: Python-urllib/2.7

This doesn't contain any authentication credentials so the response is
HTTP/401, and the client doesn't retry with credentials. The response
does come from the remote as I can see there is a WWW-Authenticate
header and it is from an Apache Tomcat server - so it makes it through
the proxy server.

Code
================
url = 'http://....../services/services/JobService-0.0.1?wsdl'
proxy = urllib2.ProxyHandler({'http': 'http://.....:3128'})
transport = suds.transport.http.HttpAuthenticated()
transport.urlopener = urllib2.build_opener(proxy)
client = suds.client.Client(url, transport=transport,
username='******', password='********')
.....

I've tried the above as well as the method described at
<http://blogs.oucs.ox.ac.uk/inapickle/2011/05/14/exchange-web-services-suds-and-python/> It has the same problem.


Back Trace
================
Traceback (most recent call last):
File "etrace.py", line 30, in <module>
client = suds.client.Client(url, transport=transport,
username='*******', password='*****')
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/client.py", line 112, in __init__
self.wsdl = reader.open(url)
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/reader.py", line 152, in open
d = self.fn(url, self.options)
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/wsdl.py", line 136, in __init__
d = reader.open(url)
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/reader.py", line 79, in open
d = self.download(url)
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/reader.py", line 95, in download
fp = self.options.transport.open(Request(url))
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/transport/http.py", line 173, in open
return HttpTransport.open(self, request)
File
"/usr/local/lib/python2.7/site-packages/suds-0.4-py2.7.egg/suds/transport/http.py", line 64, in open
raise TransportError(str(e), e.code, e.fp)
suds.transport.TransportError: HTTP Error 401: Unauthorized

--
System & Network Administrator [ LPI & NCLA ]
<http://www.whitemiceconsulting.com>
OpenGroupware Developer <http://www.opengroupware.us>
Adam Tauno Williams


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Can't get around HTTP/401 response using SUDS [SOLVED] Adam Tauno Williams Python 0 03-10-2012 01:36 PM
Help with suds: HTTP Error 401 Eric von Horst Python 3 06-21-2010 07:11 PM
[suds] how to convert a sudsobject into its representative XML? Phlip Python 1 06-18-2010 07:30 PM
python SUDS library yamamoto Python 1 03-04-2010 09:43 PM
suds problem Fencer Python 2 01-07-2010 12:10 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57