如何将类型为ObjectProxy的WebService结果转换为XML?

时间:2009-05-28 20:53:20

标签: xml flex actionscript-3 web-services

我有一个WebService,它在SOAP响应中返回XML:

<?xml version="1.0" encoding="utf-8" ?> 
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
    <soap:Body>
        <GetConfigResponse xmlns="Web.Services">
            <GetConfigResult>
                <Configuration xmlns="">
                    <Stuff>False</Stuff> 
                    <MoreStuff>
                        <Report_Format>PDF</Report_Format> 
                        <Report_Sections>
                            <Report_Section>
                                <idNmb>1</idNmb> 
                                <name>Report 1</name> 
                                <isDefault>true</isDefault> 
                                <isVisible>true</isVisible> 
                            </Report_Section>
                            <Report_Section>
                                <idNmb>2</idNmb> 
                                <name>Report 2</name> 
                                <isDefault>false</isDefault> 
                                <isVisible>true</isVisible> 
                            </Report_Section>
                        </Report_Sections>
                    </MoreStuff>
                </Configuration>
            </GetConfigResult>
        </GetConfigResponse>
    </soap:Body>
</soap:Envelope>

当我调用此WebService时,Flex调试器显示ResultEvent.result的类型是“ObjectProxy”。当我尝试将此值转换为XML时,它会跟踪为“[object Object]”,并且我无法访问XML节点。对于我调用的大多数其他WebServices,ResultEvent.result的类型为“Array”,并且可以毫无问题地转换为XML。

如何将此结果存储为XML?

1 个答案:

答案 0 :(得分:3)

将您的请求/操作的resultFormat设置为"e4x",它将返回XML个对象,而不是将结果转换为ObjectProxy