【发布时间】:2019-08-08 15:07:14
【问题描述】:
我对我的肥皂响应的特定部分的反序列化有点迷失了。
回应:
<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/"><soapenv:Body>
<ns1:LoginResult xmlns:ns1="http://abc.def.schema">
<sessionId>123456789</sessionId>
<sessionTimeout>30</sessionTimeout>
<organizationName>WebService Test Account XYZ</organizationName>
<userInfoResult>
<accessibleOrgs>
<name>WebService Test Account XYZ</name>
<description/>
<prefix>10</prefix>
<countryCallingCode>+49</countryCallingCode>
<treeLevel>0</treeLevel>
<timeZone>
<timeZoneId>Europe/Berlin</timeZoneId>
<currentUtcOffset>3600000</currentUtcOffset>
</timeZone>
<billingCompany>COMPANY 123</billingCompany>
<language>DE</language>
</accessibleOrgs>
<isDemo>true</isDemo>
<prefixLength>0</prefixLength>
<alarmNumberLength>0</alarmNumberLength>
<groupNumberLength>0</groupNumberLength>
<personNumberLength>0</personNumberLength>
</userInfoResult>
</ns1:LoginResult>
</soapenv:Body>
我需要反序列化“LoginResult”部分。我知道反序列化方法,但我正在为 A) 有命名空间和 B) 我只需要 XML 的一个子集而苦苦挣扎。
也许有人可以为我指明正确的方向。
提前谢谢
【问题讨论】:
-
xml 的什么子集?
-
正如我的帖子中提到的,我需要“LoginResult”部分。但我会检查 EyIM 的建议,会给出反馈:)
标签: c# xml serialization deserialization xml-namespaces