Hi András,
I've heard this before, but it seemed so impractical for me. The wsdl
definition may change over time
and I do not see why suds can not download it easily, exactly I do so,
using urllib:
filename='/tmp/file.wsdl'
url='file://%s' % filename
o=open(filename,'w')
for jj in
urllib.urlopen('http://username:password@webservices.IZSLER.it/wsTestAnagrafeIZSLER/gestioneUO.php?wsdl'):
o.write(jj)
o.close()
j
Veres-Szentkiralyi Andras wrote:
Hi,
this had been discussed several times, here's my answer from back then:
if the WSDL doesn't change frequently, you should just download it with the
HTTP client of your choice, and instantiate the Client object with a local
file name. The WSDL still containts the endpoint URL, so it won't mess up the
invocation part, which will use the credentials you provided.
Regards,
András Veres-Szentkirályi
2012. May 4. péntek 12:04:21 dátummal jo ezt írta:
> Hi all,
>
> I have some problems accessing this ws.
> I can get the wsdl by putting the credentials directly in the url as in:
>
>
http://xxxxxxxxxx:yyyyyyyy@webservices.IZSLER.it/wsTestAnagrafeIZSLER/gesti
> oneUO.php?wsdl
>
> but when I try passing the credentials using HttpAuthenticated, I get
> 401 error:
>
> ------------------------------------------------
> # -*- coding: utf-8 -*-
> from suds.client import Client
>
> username="xxxxxxxx"
> password="yyyyyyyy"
> url = 'https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl'
> from suds.transport.http import HttpAuthenticated
> t = HttpAuthenticated(username=username, password=password)
> client=Client(url=url, transport=t)
> print client
>
> --------------------
>
> DEBUG:suds.wsdl:reading wsdl at:
>
https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl ...
> DEBUG:suds.transport.http:opening
> (
https://webservices.IZSLER.it/wsAnagrafeIZSLER/gestioneUO.php?wsdl)
> Traceback (most recent call last):
> File "testIZS.py", line 16, in <module>
> client=Client(url=url, transport=t)
> 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/http.py", line 173,
> in open
> File "build/bdist.linux-x86_64/egg/suds/transport/http.py", line 64,
> in open
> suds.transport.TransportError: HTTP Error 401: Authorization Required
>
> -----------------
> Thanks for any help.
> j
>
_______________________________________________
suds mailing list
suds(a)lists.fedoraproject.org
https://admin.fedoraproject.org/mailman/listinfo/suds
--
Jose Soares Da Silva _/_/
Sferacarta Net
Via Bazzanese 69 _/_/ _/_/_/
40033 Casalecchio di Reno _/_/ _/_/ _/_/
Bologna - Italy _/_/ _/_/ _/_/
Ph +39051591054 _/_/ _/_/ _/_/ _/_/
fax +390516131537 _/_/ _/_/ _/_/ _/_/
web:www.sferacarta.com _/_/_/ _/_/_/
Le informazioni contenute nella presente mail ed in ogni eventuale file allegato sono
riservate e, comunque, destinate esclusivamente alla persona o ente sopraindicati, ai
sensi del decreto legislativo 30 giugno 2003, n. 196. La diffusione, distribuzione e/o
copiatura della mail trasmessa, da parte di qualsiasi soggetto diverso dal destinatario,
sono vietate. La correttezza, l’integrità e la sicurezza della presente mail non possono
essere garantite. Se avete ricevuto questa mail per errore, Vi preghiamo di contattarci
immediatamente e di eliminarla. Grazie.
This communication is intended only for use by the addressee, pursuant to legislative
decree 30 June 2003, n. 196. It may contain confidential or privileged information. You
should not copy or use it to disclose its contents to any other person. Transmission
cannot be guaranteed to be error-free, complete and secure. If you are not the intended
recipient and receive this communication unintentionally, please inform us immediately and
then delete this message from your system. Thank you.