0

我想将 Soap 响应转换为数组,我的响应如下:

<?xml version="1.0" ?>
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
    <s:Header>
        <h:ServerVersionInfo ......../>
    </s:Header>
    <s:Body>
        <m:FindItemResponse .......>
            <m:ResponseMessages>
                <m:FindItemResponseMessage ResponseClass="Success">
                    <m:ResponseCode>NoError</m:ResponseCode>
                    <m:RootFolder IncludesLastItemInRange="false" IndexedPagingOffset="2" TotalItemsInView="3">
                        <t:Items>
                            <t:Contact>
                                <t:ItemId ChangeKey=".." Id="....."/>
                                <t:ParentFolderId ChangeKey="AQAAAA==" Id="AQMkADc5Y2ViMmY5LTU0OTkALTQ1NmItODU0OS02ZDc4ZjZmNzM3MzIALgAAA71jNmenEatOn4H7Ntp3sEUBAMkdzXyQLFpDkRbRsnVGlRoAAAIBDwAAAA=="/>
                                <t:ItemClass>IPM.Contact</t:ItemClass>
                                <t:Subject>teting kk dev</t:Subject>
                                <t:Sensitivity>Normal</t:Sensitivity>
                                <t:DateTimeReceived>2013-10-04T11:05:39Z</t:DateTimeReceived>
                                .
                                .
                                .
                                .
                                <t:EmailAddresses>
                                    <t:Entry Key="EmailAddress1">test@test.com</t:Entry>
                                </t:EmailAddresses>
                                <t:Surname>dev</t:Surname>
                            </t:Contact>
                            <t:Contact>
                                .
                                .
                                .
                                .
                                .
                            </t:Contact>
                        </t:Items>
                    </m:RootFolder>
                </m:FindItemResponseMessage>
            </m:ResponseMessages>
        </m:FindItemResponse>
    </s:Body>
</s:Envelope>

我主要想要里面的东西是一个数组,因此如果我想使用 subject ,我可以将其作为 arr['Subject'] 访问并返回 testing kk dev。

所以请建议我一些方法来做到这一点。谢谢

4

0 回答 0