xml格式封装数据
xml层级关系 XDocument obj = new XDocument(new XDeclaration("1.0", "utf-8", "yes")); //构造根节点 obj.Add(new XElement("request", new XElement("criteriaList", new XElement("criteria", new XElement("warehouseCode", warehousecode), new XElement("ownerCode", whse), new XElement("itemCode", sku.sku), new XElement("itemId", ""))))); XmlDocument doc = new XmlDocument(); doc.LoadXml(obj.ToString()); var obj = new JObject { {"?xml",new JObject { {"@version","1.0" }, {"@encoding","utf-8"} } }, { "request", new JObject { {"actionType","add"}, {"warehouseCode", warehousecode}, {"ownerCode", whse}, {"supplierCode", ""}, {"supplierName", "" }, { "item", j }, {"extendProps", new JObject { {"key1", "" }, {"key2", "" }, {"key3", "" }, {"key4", "" }, {"key5", "" } } } } } }; XmlDocument doc = (XmlDocument)JsonConvert.DeserializeXmlNode(JsonConvert.SerializeObject(obj));
相关推荐
liqing 2020-04-18
wulaxiaohei 2020-02-20
lightlanguage 2020-02-18
sixthelement 2020-01-13
impress 2020-01-01
lionelf 2014-06-03
zxznsjdsj 2019-10-20
zhuyonge 2016-05-19
helloworlddm 2010-12-15
faiculty 2011-12-18
Stephenmu 2014-08-19
lionelf 2014-06-03
LetonLIU 2013-09-16
Godfavoredone 2019-06-28
黎俊杰的DBA生涯 2011-09-29
panpanhappy 2015-06-28
88251546 2015-03-28
sparkstrike 2014-04-24
DwyaneCoding 2013-07-30