[英]xmlns=''> was not expected. - There is an error in XML document (2, 2) while DeserializeXml to object
[英]C# Deserilize from xml to object (<result xmlns=''> was not expected.)
我嘗試從XML到對象脫鹽。 當我嘗試執行此代碼時,出現此內部異常消息,這不是預期的錯誤消息。 。 請幫我。 感謝您的答復。
<?xml version="1.0" encoding="UTF-8"?>
<result>
<status>
<interfaceId>shop.shipping.segment.get</interfaceId>
<systemStatus>OK</systemStatus>
<message>OK</message>
<requestId>714a4983-555f-42d9-aeea-89dae89f2f55</requestId>
<requests>
<id>1</id>
<kbnId>1</kbnId>
</requests>
</status>
<tns:shopMngApiResponse xmlns:tns="http://rakuten.co.jp/rms/mall/shop/mng/api/model/resource">
<resultCode>N000</resultCode>
<resultMessageList>
<resultMessage>
<code>N000</code>
<message>Succeeded.</message>
</resultMessage>
</resultMessageList>
<result xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="tns:soryoKbnResourceModel">
<soryoKbnList>
<soryoKbn>
<shopId>202317</shopId>
<kbnId>1</kbnId>
<id>1</id>
<name>test name 1</name>
</soryoKbn>
<soryoKbn>
<shopId>202317</shopId>
<kbnId>2</kbnId>
<id>7</id>
<name>test name 2</name>
</soryoKbn>
</soryoKbnList>
</result>
</tns:shopMngApiResponse>
</result>
源代碼: https : //app.box.com/s/mmuk2ndkmz4llb71ryw81rpzca9mrmge
反序列化為“結果”-對象時,請按如下所示設置屬性:
[XmlElement(ElementName = "result", Form = XmlSchemaForm.Qualified)]
public YOURRESULTOBJECT result { get; set; }
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.