我有WCF REST服务返回JSON,我得到的回应JSON字符串但经过反序列它给空对象,JSON包含其中包含列表响应对象,前反序列串JSON字符串显示3个DTOStundet对象反序列列表显示空后反序列化的Json使用NewtonJS
string returnValue = Navigator.GET(url, APIHearderCollection);
{
"GetStudentsListJSONResult":
{
"response":
{
"DTOStudentList":[
{
"Address":"Kandy",
"Age":20,
"CourseName":"Physical Sience",
"DateOfBirth":"\/Date(318191400000+0530)\/",
"StudentId":1,"StudentName":"Kumar Sangakkara",
"TelePhoneNumber":"071975769"
},
{
"Address":"Colombo",
"Age":21,"CourseName":"Physical Sience",
"DateOfBirth":"\/Date(2658600000+0530)\/",
"StudentId":2,"StudentName":"Mahela Jayawardena",
"TelePhoneNumber":"071975759"
}
],
"ResponseStatus":0
}
}
}
的returnValue包含此JSON字符串是反序列这里
图片说明] 1
这就是IM反序列化JSON之后这种反应得到空
Response response = (Response)Newtonsoft.Json.JsonConvert.DeserializeObject(returnValue, typeof(Response));
仍然为空列表 –
你检查它,你的'returnValue'不为空? – Mostafiz
是的,它不是空它有列表中的对象 –