Results 1 to 2 of 2

Thread: "Invalid JSON primitive" when calling service

  1. #1

    Default "Invalid JSON primitive" when calling service

    Hi All,

    I would like to update data when an event is raised. My service in charge to do that works good and set the values correctly when I invoke it via the browser but not from my app...

    I get the following error:

    {"Message":"Invalid JSON primitive: page.","StackTrace":" at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializePrimitiveObject()\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeInternal(Int32 depth)\r\n at System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeserialize(String input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize(JavaScriptSerializer serializer, String input, Type type, Int32 depthLimit)\r\n at System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](String input)\r\n at System.Web.Script.Services.RestHandler.GetRawParamsFromPostRequest(HttpContext context, JavaScriptSerializer serializer)\r\n at System.Web.Script.Services.RestHandler.GetRawParams(WebServiceMethodData methodData, HttpContext context)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.ArgumentException"}
    Here is the content of my event:

                        url: '../Service.asmx/SetNewsItemPublishStatus',
                        method: 'POST',
                        headers: {
                            'Content-Type': 'application/json;charset=utf-8'
                        params: {
                            param1: 516,
                            param2: 4
                        failure: function (response) { },
                        success: function (response, opts) { alert('success!'); }

    I would appreciate your help,
    Thank you

  2. #2


    I also get the same error when I try to load more items in a list component.

    The pageSize property of my data store is set to 20, by clicking on a button an event is fired and call the store.nextPage() method, but I always get: "Invalid JSON primitive.."

    Do you guys have any idea about my issue?
    Thank you

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts