1
我有一个json字符串,我想要反序列化以访问特定成员。反序列化嵌套的json字符串导致空值
string sResponse = "{\"BALANCERESPONSE\":{\"@xmlns\":\"\",\"RESPONSECODE\":\"0\",\"RESPONSEMESSAGE\":\"Success\"}}";
Response conObj = new Response();
conObj = JsonConvert.DeserializeObject<Response>(sResponse);
public class BALANCERESPONSE
{
public string RESPONSECODE { get; set; }
public string RESPONSEMESSAGE { get; set; }
}
public class Response
{
public BALANCERESPONSE resp_onse { get; set; }
}
我得到的resp_onse
属性null
值。我在这里做错了什么?