On 21/12/11 10:54, jose soares wrote:
> Robin Wittler wrote:
>
>> On 21/12/11 08:29, jo wrote:
>>
>>
>>> 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
>> _______________________________________________
>> suds mailing list
>> suds(a)lists.fedoraproject.org
>>
https://admin.fedoraproject.org/mailman/listinfo/suds
>>
> The problem here is not the credentials, Robin.
> I don't know why you have a different response from me, even using the
> fake credentials.
>
> The following two rows :
>
> from suds.client import Client
>
Client(url='https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl',
> username="us", password="pwd")
>
> don't giveme a 401 error but this result instead:
>
> Traceback (most recent call last):
> File "o", line 2, in <module>
>
Client(url='https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl',
> username="us", password="pwd")
> File "build/bdist.linux-x86_64/egg/suds/client.py", line 112, in __init__
> File "build/bdist.linux-x86_64/egg/suds/reader.py", line 152, in open
> File "build/bdist.linux-x86_64/egg/suds/wsdl.py", line 136, in __init__
> File "build/bdist.linux-x86_64/egg/suds/reader.py", line 79, in open
> File "build/bdist.linux-x86_64/egg/suds/reader.py", line 95, in download
> File "build/bdist.linux-x86_64/egg/suds/transport/https.py", line 60, in
> open
> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 62, in
> open
> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 118, in
> u2open
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 397, in open
> response = meth(req, response)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 510, in
> http_response
> 'http', request, response, code, msg, hdrs)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 429, in error
> result = self._call_chain(*args)
> 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 855, in
> http_error_401
> url, req, headers)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 833, in
> http_error_auth_reqed
> return self.retry_http_basic_auth(host, req, realm)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 843, in
> retry_http_basic_auth
> return self.parent.open(req, timeout=req.timeout)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 397, in open
> response = meth(req, response)
> --------------------------------------------------------------------------------
> LOOP 107 TIMES ------------------------
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 510, in
> http_response
> 'http', request, response, code, msg, hdrs)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 429, in error
> result = self._call_chain(*args)
> 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 855, in
> http_error_401
> url, req, headers)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 833, in
> http_error_auth_reqed
> return self.retry_http_basic_auth(host, req, realm)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 843, in
> retry_http_basic_auth
> return self.parent.open(req, timeout=req.timeout)
> File "/home/jose/.virtualenv/lib/python2.6/urllib2.py", line 391, in open
> response = self._open(req, data)
> 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
>
>
Well, i can not reproduce the error (and now i also test it with suds
0.4.2).
I suggest you read about how to do logging in suds:
https://fedorahosted.org/suds/wiki/Documentation#LOGGING
and provide us with more information.
with logging in DEBUG level there are only two added rows at the top of
traceback :
DEBUG:suds.wsdl:reading wsdl at:
)
Traceback (most recent call last):
File "o", line 2, in <module>
Client(url='https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl',username="us",
password="pwd")
.... <I avoid to put here the rest of the traceback because it is
exactly like before>
import logging
logging.basicConfig(level=logging.DEBUG)
logging.getLogger('suds.client').setLevel(logging.DEBUG) (I also tried
suds.transport and suds.wsdl with the same result)
from suds.client import Client
Client(url='https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl',
username="us", password="pwd")