I am consuming wcf rest service which is returning json as output.
{
"VerifyEmailResult":{
"EmailQueryResult":{
"query":{
"count":1,
"created":"2014-04-23T08:38:04Z",
"email":"test12%40yahoo.com",
"lang":"en-US",
"queryType":"EmailAgeVerification",
"responseCount":0,
"results":[
]
},
"responseStatus":{
"description":"Authentication Error: The signature doesn’t match or the user\/consumer key file wasn’t found.",
"errorCode":3001,
"status":"failed"
}
},
"Message":"Error occurred",
"ResponseMessage":"Failure",
"ResultCode":"0"
}
}
How can I deserialize the same. I don't have any class for json response.
I have to read json and to display some data from json.
Thanks
Here are your classes:
you can use JSON2Csharp.com to get generated classes for you Json in C#.
Use Newton Soft Json library to Deserialize json.
you can Deserialise using this method of library:
In my case i was sending a web request to a Restful service and json was returning as string.
If you don't have classes for json string, You can deserialize to dynamic object at runtime.
Example:
Try it online
Output: