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
值。我在這裏做錯了什麼?