【很急】求大神们帮忙看看这个反序列化有关问题
【很急】求大神们帮忙看看这个反序列化问题
这是我的xml报文
实体反序列化:
结果只拿到了
<status>推送状态</status>
<inventory_version>库存版本</inventory_version>
<inventory_time>库存时间</inventory_time> 这3个节点的值
List 里面的值无法获取,求指教
------解决思路----------------------
<on_hand_qty>在库库存数量</on_hand_qty>
这段随便改成一个数字就可以,不改没办法的
这是我的xml报文
<?xml version="1.0" encoding="UTF-8"?><wmsInventoryBalancePushInfo>
<status>推送状态</status>
<inventory_version>库存版本</inventory_version>
<inventory_time>库存时间</inventory_time>
<list>
<item>
<id>记录号</id>
<company>货主</company>
<warehouse>仓库</warehouse>
<item>商品编号</item>
<on_hand_qty>在库库存数量</on_hand_qty>
<lot>批号</lot>
<expiration_date>有效期</expiration_date>
<inventorySts>库存状态</inventorySts>
<user_def1>预留字段</user_def1>
<user_def2>预留字段</user_def2>
<user_def3>预留字段</user_def3>
<user_def4>预留字段</user_def4>
<user_def5>预留字段</user_def5>
<user_def6>预留字段</user_def6>
<user_def7>预留字段</user_def7>
<user_def8>预留字段</user_def8>
</item>
</list>
</wmsInventoryBalancePushInfo>
实体反序列化:
public class wmsInventoryBalancePushInfo
{
public string status { get; set; }
public string inventory_version { get; set; }
public string inventory_time { get; set; }
[XmlElement(ElementName = "item")]
public List<wmsInventoryBalancePushItemInfo> list { get; set; }
}
public class wmsInventoryBalancePushItemInfo
{
public string company { get; set; }
public string warehouse { get; set; }
public string item { get; set; }
public decimal on_hand_qty { get; set; }
public string lot { get; set; }
public string expiration_date { get; set; }
public string inventorySts { get; set; }
}
结果只拿到了
<status>推送状态</status>
<inventory_version>库存版本</inventory_version>
<inventory_time>库存时间</inventory_time> 这3个节点的值
List 里面的值无法获取,求指教
------解决思路----------------------
<on_hand_qty>在库库存数量</on_hand_qty>
这段随便改成一个数字就可以,不改没办法的