mismatch in UserServices::loginUser: Expected <type 'unicode'> recieved <type 'str'>

Asked by oyzzo on 2011-10-20

I get this error when i execute this method:

 def loginUser(self,userid,userpass):

mismatch in UserServices::loginUser: Expected <type 'unicode'> recieved <type 'str'>

I'm testing all the methods from validwsdl.com and i have some others accepting PORTABLE_STRING parameters and they just work fine, but this one gives me the unicode/str error. Even the methods where i accept one parameter that's a custom type formed by other types including integers and strings is working fine, so i cannot figure what's going wrong... The only difference is that i use the incomming string to do a comparation like this: if userpass == somepass: ...

but before comparing i use unicode function to turn them both to unicode so in the comparation they are both unicode.

Question information

English Edit question
ladon Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Best jsgaarde (jakob-simon-gaarde) said : #1

Hi Oyzzo.

My guess is that you are not returning a unicode string, but I can't say for sure cause you don't show the full traceback nor the full method implementation.

Remember - It's much easier to answer questions when I get the full story (meaning, the whole method and the full exception traceback)

Best Regards
Jakob Simon-Gaarde

oyzzo (oyzzoforfree) said : #2

Hi jsgaarde,

You are right, i wasn't returning an unicode string.

thanks a lot again!

oyzzo (oyzzoforfree) said : #3

Thanks jsgaarde, that solved my question.