Hello
Is the first time I am trying connect to a soap web service using using python. Existing libraries are very poor in my opinion (mainly by the interface) but I like suds and would like use it because is very pleasant. But I have a problem with the concrete serviece I need to use and I didn't find the solution.
The service description is: https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?WSDL and I neet call to "Logon" function. The service runs correctly (I can use it with ZSI)
I tried:
{{{ vojo_auth_uri = "https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?wsdl" logger('suds.serviceproxy').setLevel(logging.DEBUG) auth_proxy = ServiceProxy(vojo_auth_uri) logon = auth_proxy.get_instance('Logon') logon.Username.append("user") logon.Password.append("password") print auth_proxy.Logon(logon)
}}}
When I run that code I get this error "You must specify both your username and password.at FreewayAuth.Logon(String Username, String Password)"
The problem is that suds does NOT send a correct xml. The service expects (as documented in https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?op=Logon ):
<?xml version="1.0" encoding="utf-8"?> <soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/%22%3E soap:Body <Logon xmlns="http://tempuri.org/"> <Username>string</Username> <Password>string</Password> </Logon> </soap:Body> </soap:Envelope>
But the library send:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Logon <Username> <Username>user</Username> <Password>password</Password> </Username> </tns:Logon> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The error: Note the extra Username tag.
Am I using the library correctly? Is an library error?
Thanks in advance
PD: Please excuse my bad english
Hello Pablo,
I tried analyzing the WSDL you gave, and it seems that the "Logon" method does not take a "Logon" instance, but two strings; username and password.
Here's my code:
import logging from suds.serviceproxy import ServiceProxy
p = ServiceProxy('freeway.wsdl') logging.getLogger('suds.serviceproxy').setLevel(logging.DEBUG)
print p.Logon('foo', 'bar')
And here's what suds sends:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/ " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Logon <Username>foo</Username> <Password>bar</Password> </tns:Logon> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The service still raises an error: faultstring = (System.Web.Services.Protocols.SoapException: You must specify both your username and password.at FreewayAuth.Logon(String Username, String Password))
...but that might be due to the wrong username and password?
HTH, Jesper
On May 16, 2008, at 10:12 AM, Pablo Caro Revuelta wrote:
Hello
Is the first time I am trying connect to a soap web service using using python. Existing libraries are very poor in my opinion (mainly by the interface) but I like suds and would like use it because is very pleasant. But I have a problem with the concrete serviece I need to use and I didn't find the solution.
The service description is: https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?WSDL and I neet call to "Logon" function. The service runs correctly (I can use it with ZSI)
I tried:
{{{ vojo_auth_uri = "https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?wsdl" logger('suds.serviceproxy').setLevel(logging.DEBUG) auth_proxy = ServiceProxy(vojo_auth_uri) logon = auth_proxy.get_instance('Logon') logon.Username.append("user") logon.Password.append("password") print auth_proxy.Logon(logon)
}}}
When I run that code I get this error "You must specify both your username and password.at FreewayAuth.Logon(String Username, String Password)"
The problem is that suds does NOT send a correct xml. The service expects (as documented in https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?op=Logon ):
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/%22%3E soap:Body
<Logon xmlns="http://tempuri.org/"> <Username>string</Username> <Password>string</Password> </Logon> </soap:Body> </soap:Envelope>
But the library send:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Logon <Username> <Username>user</Username> <Password>password</Password> </Username> </tns:Logon> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The error: Note the extra Username tag.
Am I using the library correctly? Is an library error?
Thanks in advance
PD: Please excuse my bad english
--
Pablo Caro Revuelta pcaro@yaco.es
Yaco Sistemas S.L. http://www.yaco.es C/ Sierpes 48, 41004 Sevilla (España) Teléfono: 954 50 00 57 Fax 954 50 09 29
Este mensaje y sus documentos anexos son confidenciales y dirigidos exclusivamente a los destinatarios de los mismos. Si por error, ha recibido este mensaje y no es el destinatario, por favor, notifíqueselo al remitente y no use, informe, distribuya, imprima, copie o difunda este mensaje por ningún medio.
This message and any attached files are confidential. They are for the intended recipients only. If an error has misdirected this e-mail to you, please, notify the author and do not use, disclose, distribute, copy, print or relay this e-mail.
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
Hello Jesper,
Thank you very much for your response. A response in 15 minutes! I really want to use suds :-D
I tested the code you send me with the correct username and password but I have the same error. I dont know why because It looks like a correct xml.
Maybe you can help me better if I give you more information. The ZSI code that works is: {{{ from FreewayAuth_services import * fp = open('debug.out', 'a') proxy = FreewayAuthLocator().getFreewayAuthSoap(tracefile=fp) logon = LogonSoapIn() logon._Username = user logon._Password = password ticket = proxy.Logon(logon) print ticket._LogonResult fp.close() }}} where FreewayAuth_services came from wsdl2py -u https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?WSDL
The xmls in debug.out is:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22%3ESOAP-ENV:Header</SOAP-ENV:Header><SOAP-ENV:Body xmlns:ns1="http://tempuri.org/%22%3Ens1:Logonns1:UsernameUSER</ns1:Username>ns1:PasswordBLABLA</ns1:Password></ns1:Logon></SOAP-ENV:Body></SOAP-ENV:Envelope>
The xml output is diferent, maybe ZSI runs because it use namespaces. How can I do it with suds?
Cheers
El Viernes 16 May 2008, Jesper Noehr escribió:
Hello Pablo,
I tried analyzing the WSDL you gave, and it seems that the "Logon" method does not take a "Logon" instance, but two strings; username and password.
Here's my code:
import logging from suds.serviceproxy import ServiceProxy
p = ServiceProxy('freeway.wsdl') logging.getLogger('suds.serviceproxy').setLevel(logging.DEBUG)
print p.Logon('foo', 'bar')
And here's what suds sends:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/ " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Logon <Username>foo</Username> <Password>bar</Password> </tns:Logon> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The service still raises an error: faultstring = (System.Web.Services.Protocols.SoapException: You must specify both your username and password.at FreewayAuth.Logon(String Username, String Password))
...but that might be due to the wrong username and password?
HTH, Jesper
Hi Pablo,
I see the error here, the problem is that the service expects fully qualified namespacing on the elements (ns1:Username vs. Username). This is specified in your WSDL by elementFormDefault="qualified". This is a known issue and Jeff is working on a fix. It should be in trunk soon.
Jeff, perhaps you could reply to this message when you've committed a fix and Pablo can test it?
Jesper
On May 16, 2008, at 11:01 AM, Pablo Caro Revuelta wrote:
Hello Jesper,
Thank you very much for your response. A response in 15 minutes! I really want to use suds :-D
I tested the code you send me with the correct username and password but I have the same error. I dont know why because It looks like a correct xml.
Maybe you can help me better if I give you more information. The ZSI code that works is: {{{ from FreewayAuth_services import * fp = open('debug.out', 'a') proxy = FreewayAuthLocator().getFreewayAuthSoap(tracefile=fp) logon = LogonSoapIn() logon._Username = user logon._Password = password ticket = proxy.Logon(logon) print ticket._LogonResult fp.close() }}} where FreewayAuth_services came from wsdl2py -u https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?WSDL
The xmls in debug.out is:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22%3E<SOAP- ENV:Header></SOAP-ENV:Header>SOAP-ENV:Body xmlns:ns1="http://tempuri.org/"ns1:Logonns1:UsernameUSER</ ns1:Username>ns1:PasswordBLABLA</ns1:Password></ns1:Logon></SOAP- ENV:Body></SOAP-ENV:Envelope>
The xml output is diferent, maybe ZSI runs because it use namespaces. How can I do it with suds?
Cheers
El Viernes 16 May 2008, Jesper Noehr escribió:
Hello Pablo,
I tried analyzing the WSDL you gave, and it seems that the "Logon" method does not take a "Logon" instance, but two strings; username and password.
Here's my code:
import logging from suds.serviceproxy import ServiceProxy
p = ServiceProxy('freeway.wsdl') logging.getLogger('suds.serviceproxy').setLevel(logging.DEBUG)
print p.Logon('foo', 'bar')
And here's what suds sends:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/ " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Logon <Username>foo</Username> <Password>bar</Password> </tns:Logon> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The service still raises an error: faultstring = (System.Web.Services.Protocols.SoapException: You must specify both your username and password.at FreewayAuth.Logon(String Username, String Password))
...but that might be due to the wrong username and password?
HTH, Jesper
--
Pablo Caro Revuelta pcaro@yaco.es
Yaco Sistemas S.L. http://www.yaco.es C/ Sierpes 48, 41004 Sevilla (España) Teléfono: 954 50 00 57 Fax 954 50 09 29
Este mensaje y sus documentos anexos son confidenciales y dirigidos exclusivamente a los destinatarios de los mismos. Si por error, ha recibido este mensaje y no es el destinatario, por favor, notifíqueselo al remitente y no use, informe, distribuya, imprima, copie o difunda este mensaje por ningún medio.
This message and any attached files are confidential. They are for the intended recipients only. If an error has misdirected this e-mail to you, please, notify the author and do not use, disclose, distribute, copy, print or relay this e-mail.
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
Hello,
When jeff send commit the fix, I will be pleased testing it.
cheers!
El Viernes 16 May 2008, Jesper Noehr escribió:
Hi Pablo,
I see the error here, the problem is that the service expects fully qualified namespacing on the elements (ns1:Username vs. Username). This is specified in your WSDL by elementFormDefault="qualified". This is a known issue and Jeff is working on a fix. It should be in trunk soon.
Jeff, perhaps you could reply to this message when you've committed a fix and Pablo can test it?
Jesper
Yes, definitely. I'll post to the list when I have the defaultElementForm stuff committed.
Jesper Noehr wrote:
Hi Pablo,
I see the error here, the problem is that the service expects fully qualified namespacing on the elements (ns1:Username vs. Username). This is specified in your WSDL by elementFormDefault="qualified". This is a known issue and Jeff is working on a fix. It should be in trunk soon.
Jeff, perhaps you could reply to this message when you've committed a fix and Pablo can test it?
Jesper
On May 16, 2008, at 11:01 AM, Pablo Caro Revuelta wrote:
Hello Jesper,
Thank you very much for your response. A response in 15 minutes! I really want to use suds :-D
I tested the code you send me with the correct username and password but I have the same error. I dont know why because It looks like a correct xml.
Maybe you can help me better if I give you more information. The ZSI code that works is: {{{ from FreewayAuth_services import * fp = open('debug.out', 'a') proxy = FreewayAuthLocator().getFreewayAuthSoap(tracefile=fp) logon = LogonSoapIn() logon._Username = user logon._Password = password ticket = proxy.Logon(logon) print ticket._LogonResult fp.close() }}} where FreewayAuth_services came from wsdl2py -u https://freeway.demo.lionbridge.com/vojo/FreewayAuth.asmx?WSDL
The xmls in debug.out is:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ZSI="http://www.zolera.com/schemas/ZSI/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance%22%3ESOAP-ENV:Header</SOAP-ENV:Header><SOAP-ENV:Body
xmlns:ns1="http://tempuri.org/%22%3Ens1:Logonns1:UsernameUSER</ns1:Username>ns1:PasswordBLABLA</ns1:Password></ns1:Logon></SOAP-ENV:Body></SOAP-ENV:Envelope>
The xml output is diferent, maybe ZSI runs because it use namespaces. How can I do it with suds?
Cheers
El Viernes 16 May 2008, Jesper Noehr escribió:
Hello Pablo,
I tried analyzing the WSDL you gave, and it seems that the "Logon" method does not take a "Logon" instance, but two strings; username and password.
Here's my code:
import logging from suds.serviceproxy import ServiceProxy
p = ServiceProxy('freeway.wsdl') logging.getLogger('suds.serviceproxy').setLevel(logging.DEBUG)
print p.Logon('foo', 'bar')
And here's what suds sends:
<SOAP-ENV:Envelope xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/ " xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tns="http://tempuri.org/ " xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/%22%3E SOAP-ENV:Body tns:Logon <Username>foo</Username> <Password>bar</Password> </tns:Logon> </SOAP-ENV:Body> </SOAP-ENV:Envelope>
The service still raises an error: faultstring = (System.Web.Services.Protocols.SoapException: You must specify both your username and password.at FreewayAuth.Logon(String Username, String Password))
...but that might be due to the wrong username and password?
HTH, Jesper
--
Pablo Caro Revuelta pcaro@yaco.es
Yaco Sistemas S.L. http://www.yaco.es C/ Sierpes 48, 41004 Sevilla (España) Teléfono: 954 50 00 57 Fax 954 50 09 29
Este mensaje y sus documentos anexos son confidenciales y dirigidos exclusivamente a los destinatarios de los mismos. Si por error, ha recibido este mensaje y no es el destinatario, por favor, notifíqueselo al remitente y no use, informe, distribuya, imprima, copie o difunda este mensaje por ningún medio.
This message and any attached files are confidential. They are for the intended recipients only. If an error has misdirected this e-mail to you, please, notify the author and do not use, disclose, distribute, copy, print or relay this e-mail.
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list
fedora-suds-list mailing list fedora-suds-list@redhat.com https://www.redhat.com/mailman/listinfo/fedora-suds-list