Click here to Skip to main content
15,886,067 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi All,

I am working on WCF REST Service with returning data as Json format. For one of my method, declaration as shown below,

XML
<operationcontract,>"POST", ResponseFormat:=WebMessageFormat.Json, BodyStyle:=WebMessageBodyStyle.Wrapped, UriTemplate:="GetExpenseSnapshot")>
        Function GetExpenseSnapshot(ByVal sessionkey As String, ByVal expenseReportID As Integer) As ExpenseReportSnapShot

and in my implementation, i manually formatting the data as Json format. When i debug and check, the data was displayed correctly but when checking in WCF Client, the data was displayed wrongly i.e adding "@" symbol and extra double quotes ("") for each column.

For example,
XML
 @"{""Comment"" : [{""Row"":[ {""XmlLabel"":""RestService.EXPEntity"",""expenseReportID"":"""",""expReportNotesID"":""""
}]}]}""


but i need to display like this,
XML
  {"Comment" : [{"Row":[ {"XmlLabel":"RestService.EXPEntity","expenseReportID":"","expReportNotesID":""
}]}]}


Please help me to resolve this...
Thanks
Teja MS.
Posted
Updated 28-Jan-14 22:54pm
v2

1 solution

You can check by trying to deserialize the object
C#
JsonConvert.DeserializeObject<YourReturnDataType>(YourResult)
 
Share this answer
 
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900