小编Mar*_*ber的帖子

反序列化部分 SOAP 响应

我对肥皂响应的特定部分的反序列化有点迷失。

响应:

<?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>
Run Code Online (Sandbox Code Playgroud)

我需要反序列化“LoginResult”部分。我知道反序列化方法,但我正在努力解决以下事实:A) 有命名空间,B) 我只需要 XML 的子集。

也许有人可以指出我正确的方向。

提前谢谢

c# xml serialization xml-namespaces deserialization

0
推荐指数
1
解决办法
2268
查看次数

标签 统计

c# ×1

deserialization ×1

serialization ×1

xml ×1

xml-namespaces ×1