Sebastien Lachance

Ajax, Wcf and deserialization problem

{“ExceptionDetail”:{“HelpLink”:null,”InnerException”:null,”Message”:”The token ‘"’ was expected but found ”’.”,”StackTrace”:” at

I was getting this error when doing an Ajax call to a WCF service with jQuery.

There could be many reasons for this, but one possible fix is to use double quote instead of single quote. So changing :

data: "{'Id': '12'}"

 

to

data: '{"Id": "12"}'

will most likely resolve your problem.

Technorati Tags: ,,

Comments