[Soap-Python] UnicodeDecode error while passing parameters withfrench letters

azurIt azurit at pobox.sk
Fri Apr 13 10:30:04 CEST 2012


Hi,

use 'Unicode' type (don't forget to import it first):

@soap(Unicode, _returns=Unicode):
def sayhello(self,name):
     return "Hello %s" % name


azur



______________________________________________________________
> Od: "Thomas AYIH-AKAKPO" <thomas.akakpo at gmail.com>
> Komu: <soap at python.org>
> Dátum: 13.04.2012 10:25
> Predmet: [Soap-Python] UnicodeDecode error while passing parameters withfrench letters
>
>Hello all,
>
>I have an issue while passing parameters with french letters using soaplib 2.0
>
>Let's take a simple "Hello" function
>
>@soap(String, _returns=String):
>def sayhello(self,name):
>     return "Hello %s" % name
>
>>>>  from suds.client import Client
>>>>  wsdl = Client(url_to_wsdl)
>>>>  wsdl.service.sayhello('Thomas')
>Hello Thomas
>>>>  wsdl.service.sayhello('Jérôme')
>UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1: ordinal not in range(128)
>
>I'm quite embarassed with this, and have no idea where to look at.
>The error isn't related to the client, as some other clients receive the same error.
>Anyone got any hint?
>
>I didn't browse all the archives of this list, so forgive me if I'm repeating an issue.
>If so, please redirect me to the right one (while of course I search on my own side :) ).
>
>Thank you for any further answer.
>
>-- 
>Thomas
>
>_______________________________________________
>Soap mailing list
>Soap at python.org
>http://mail.python.org/mailman/listinfo/soap
>


More information about the Soap mailing list