转换数组中的Soap响应

时间:2013-10-07 05:05:23

标签: python xml arrays soap

我想在数组中转换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>

我主要想要这个 中的内容是一个数组,所以如果我想使用主题,我可以像arr [&#39; Subject&#39;]一样访问它并返回测试kk dev。

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

0 个答案:

没有答案