Return-Path: X-Original-To: apmail-jmeter-user-archive@www.apache.org Delivered-To: apmail-jmeter-user-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 81824106FA for ; Thu, 25 Jul 2013 07:08:13 +0000 (UTC) Received: (qmail 14916 invoked by uid 500); 25 Jul 2013 07:08:13 -0000 Delivered-To: apmail-jmeter-user-archive@jmeter.apache.org Received: (qmail 14152 invoked by uid 500); 25 Jul 2013 07:08:04 -0000 Mailing-List: contact user-help@jmeter.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "JMeter Users List" Delivered-To: mailing list user@jmeter.apache.org Received: (qmail 14135 invoked by uid 99); 25 Jul 2013 07:08:01 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 07:08:01 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of niraj.khatmode@gmail.com designates 209.85.214.179 as permitted sender) Received: from [209.85.214.179] (HELO mail-ob0-f179.google.com) (209.85.214.179) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 25 Jul 2013 07:07:55 +0000 Received: by mail-ob0-f179.google.com with SMTP id xk17so747161obc.10 for ; Thu, 25 Jul 2013 00:07:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ntNXi5qQL8WSLddubWyEwvOkiZzCAJgAgXyakQgiYtM=; b=YGLYfVgIWdDm/yOfBp16mtuLqeMxkSFvzqGAkVJbG1XWAJLm9qMcGQcVeauMk1Ezy4 ORdkI5/E6xjX90UweYC0JhcOYLCf3orEHrX6YXcl6gRCLjeMRSsmkzfgeiSnDLLJ+BLi cN9iJyUaeEBuX5wughEqsOvCy2aAuDrXx5LapMgzZ7Y8FXNqGZ2CkpiSk0VZavFoNHRv eXJlm3F4chPCNA/4l2fK9QUsyTHUiWwl1LlSZjhmBvosGFbxbdsh/WJo5+u7weTXIGo0 F32PbCa/JcNofA/93Day5pxHFYouUOyTA5yMSgy/z6Yu/ZW7BwR46YYEsr9cr9o3zdXA lgog== MIME-Version: 1.0 X-Received: by 10.182.213.162 with SMTP id nt2mr34539513obc.44.1374736053865; Thu, 25 Jul 2013 00:07:33 -0700 (PDT) Received: by 10.60.67.106 with HTTP; Thu, 25 Jul 2013 00:07:33 -0700 (PDT) In-Reply-To: References: Date: Thu, 25 Jul 2013 12:37:33 +0530 Message-ID: Subject: Re: Issue while passing JSON string to AJAX request From: Niraj To: JMeter Users List Content-Type: multipart/alternative; boundary=001a11c2f78a2696ac04e250ae24 X-Virus-Checked: Checked by ClamAV on apache.org --001a11c2f78a2696ac04e250ae24 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thanks a lot Flavio. Your answer gave me right direction to resolve my issue. Thanks once again for your valuable inputs. On Jul 24, 2013 7:21 PM, "Flavio Cysne" wrote: > I tested creating a variable, inside my browser console, using those two > JSON strings presented in your e-mail and both returned "Unexpected token > ILLEGAL" error. > > Then I tried the JSON string below and it worked. > > var myObject =3D > > {"id":"e519e615b0e01d6e80679-a353","nodeId":"WVM","callback":"","args":'{= "viewId":"87ec8bd6-b5e4-476d-93ad-4bbbbd6728c2","method":"ModifyControl","a= rgs":"{\"id\":\"eed9f0aeae7e4f83b90f1d76f4619d88\",\"args\":null}"}'}; > > See that I changed the approach of using only quotes for defining string > values and used apostrophes for the args attribute (the first one). I als= o > removed the extra slashes that turned obsolete because I could use quotes > inside apostrophes without problems. > > Maybe using extra slashes could do the work. Anyway, I suppose you are > creating these strings manually, so it should not be an issue for you to > change quotes for apostrophes. > > > 2013/7/24 Niraj > > > Hello, > > > > I am sending one ajax request to the server > > > > > http://localtest/Web/AjaxService.asmx/Request?id=3De519e615b0e01d6e80679-= a353 > > > > Post data: > > > > > {"id":"e519e615b0e01d6e80679-a353","nodeId":"WVM","callback":"","args":"{= \"viewId\":\"87ec8bd6-b5e4-476d-93ad-4bbbbd6728c2\",\"method\":\"ModifyCont= rol\",\"args\":\"{\\"id\\":\\"eed9f0aeae7e4f83b90f1d76f4619d88\\",\\"args\\= ":null}\"}"} > > > > But when i send this using JMeter, i am getting below error > > > > {"Message":"Invalid object passed in, \u0027:\u0027 or \u0027}\u0027 > > expected. (172): > > > > > {\"waid\":\"e519e615b0e01d6e80679-a353\",\"nodeId\":\"WVM\",\"callback\":= \"\",\"args\":\"{\\\"viewId\\\":\\\"87ec8bd6-b5e4-476d-93ad-4bbbbd6728c2\\\= ",\\\"method\\\":\\\"ModifyControl\\\",\\\"args\\\":\\\"{\\\\\"id\\\\\":\\\= \\"eed9f0aeae7e4f83b90f1d76f4619d88\\\\\",\\\\\"args\\\\\":null}\\\"}\"}","= StackTrace":" > > at > > > > > System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeD= ictionary(Int32 > > depth)\r\n at > > > > > System.Web.Script.Serialization.JavaScriptObjectDeserializer.DeserializeI= nternal(Int32 > > depth)\r\n at > > > > > System.Web.Script.Serialization.JavaScriptObjectDeserializer.BasicDeseria= lize(String > > input, Int32 depthLimit, JavaScriptSerializer serializer)\r\n at > > > System.Web.Script.Serialization.JavaScriptSerializer.Deserialize[T](Strin= g > > input)\r\n at > > System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContex= t > > context, WebServiceMethodData > > methodData)","ExceptionType":"System.ArgumentException"} > > > > Can some please help me to resolve the issue? > > > > Thanks, > > Niraj > > > --001a11c2f78a2696ac04e250ae24--