Jurko Gospodnetić wrote:
> Hi.
>
>> I'm trying to access to:
>>
url="https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl"
>> to have the wsdl but it requires an authentication.
>>
>> cl = Client(url)
>> suds.transport.TransportError: HTTP Error 401: Authorization Required
>>
>> I tried too:
>> cl = Client(url, username='us',password='pwd')
>>
>> wiyhout success.
>>
>> Could someone tell me how to access to this authenticated url to
>> download the wsdl like lynx do?
>>
>> lynx -source -auth=us:pwd
>>
https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl
>
> If you provide some sort of a username and password someone could
> possibly test this. Also, you did not provide the exact code you tried
> or say what exactly went wrong when you 'tried without success'.
>
> I tried just now and running:
>> url = "https://webservices.IZSLER.it/wsAnagrafeIZSLERphp?wsdl"
>> suds.client.Client(url)
>
> raises an expected exception:
>> suds.transport.TransportError: HTTP Error 401: Authorization Required
>
> while running:
>> url = "https://webservices.IZSLER.it/wsAnagrafeIZSLERphp?wsdl"
>> suds.client.Client(url, username="us", password="pwd")
>
> raises an expected exception:
>> suds.transport.TransportError: HTTP Error 401: basic auth failed
>
the correct url is:
url = 'https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl'
suds.client.Client(url=url, username="us", password="pwd")
and for me it returns a RuntimeError: maximum recursion depth exceeded
error when using username and password.
Even with real username and password (I'm sorry but I can't reveal the
real credentials because this is a production site).
mi version is:
>>> suds.__version__
'0.4'
File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 369, in
_call_chain
result = func(*args)
File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 1169, in
https_open
return self.do_open(httplib.HTTPSConnection, req)
File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 1134, in
do_open
r = h.getresponse()
File "/home/jose/.virtualenv/lib/python2.6/httplib.py", line 986, in
getresponse
response.begin()
File "/home/jose/.virtualenv/lib/python2.6/httplib.py", line 420, in begin
self.msg = HTTPMessage(self.fp, 0)
File "/home/jose/.virtualenv/lib/python2.6/mimetools.py", line 25, in
__init__
rfc822.Message.__init__(self, fp, seekable)
File "/home/jose/.virtualenv/lib/python2.6/rfc822.py", line 108, in
__init__
self.readheaders()
File "/home/jose/.virtualenv/lib/python2.6/httplib.py", line 276, in
readheaders
line = self.fp.readline()
File "/home/jose/.virtualenv/lib/python2.6/socket.py", line 397, in
readline
data = recv(1)
File "/home/jose/.virtualenv/lib/python2.6/ssl.py", line 96, in
<lambda>
self.recv = lambda buflen=1024, flags=0: SSLSocket.recv(self, buflen,
flags)
RuntimeError: maximum recursion depth exceeded
> since presumably user name "us" and password "pwd" are not
correct.
>
> Try to connect to the same URL using urllib. If you can do that -
> then suds should be able to connect to it as well (since it uses
> urllib under the hood).
>
> Hope this helps.
>
> Best regards,
> Jurko Gospodnetić
> _______________________________________________
> suds mailing list
> suds(a)lists.fedoraproject.org
>
https://admin.fedoraproject.org/mailman/listinfo/suds
Well, with your given url (and fake username and password) i am getting
a "TransportError: HTTP Error 401: basic auth failed".
So i assume that the transport layer works correctly.
I have tested this with suds version 0.3.9 + 0.4 + 0.4.1.
Unless you provide someone with the real credentials - there is nothing
more to say.
Hey, perhaps you can change the credentials for a "public" test (you
pick someone from the list, change the credentials for this person and
this person can try it, after that - just change the credentials back).
cheers,
robin