PDA

View Full Version : JSON Request Generates Syntax Error



sudheer2250
7 Dec 2011, 1:42 AM
I am trying to do a JSON request to the webserive...like below.
Ext.util.JSONP.request({
url:"https://test.com/da/Service.svc/Stats/tester",
callbackKey: 'callback',
params:{
pageIndex:"1",
pageSize:"10",
authToken:"365879521236584452"
},
callback: function(response) {
formValues.setValue({
fromDate:"",
toDate:"",
conf:"",
passLName:"",
passFName:"",

});
console.log(JSON.decode(response));
}
});

I am getting the following error with all my services. "Uncaught SyntaxError: Unexpected token :". Is any thing wrong with my code or is it problem from the 'Service."

Thanks in advance.

mitchellsimoens
9 Dec 2011, 11:19 AM
What does your response look like?

sudheer2250
9 Dec 2011, 6:25 PM
Anticipated Output:
{
"Code": 0,
"Text": "OK",
"Statuses": [
{
"TestCode": "ARR",
"Description": "Arr1"
},
{
"TestCode": "ASN",
"TestDescription": "Assgn"
},
{
"TestCode": "CXL",
"TestDescription": "Done"
}
]
}