Php 函数的作用是:返回单个XML字符串

Php 函数的作用是:返回单个XML字符串,php,soap,soap-client,Php,Soap,Soap Client,我在使用PHP SoapClient()函数时遇到困难。SOAP请求成功,但响应作为一个对象返回,该对象包含一个键为“any”的XML字符串。例如: <?php $params = array('strUsername' => 'Test', 'strPassword' => 'Test'); $client=new SoapClient('http://www.example.com/webservice.asmx?wsdl',

我在使用PHP SoapClient()函数时遇到困难。SOAP请求成功,但响应作为一个对象返回,该对象包含一个键为“any”的XML字符串。例如:

<?php
$params = array('strUsername' => 'Test',
                'strPassword' => 'Test');

$client=new SoapClient('http://www.example.com/webservice.asmx?wsdl',
                       array('features' => SOAP_SINGLE_ELEMENT_ARRAYS));

$result = $client->strExampleCall($params);
print_r($result);
?>
为什么PHP不将SOAP响应解析为返回对象的属性


我正在使用PHP5.3.0,并且相信SOAP服务器正在运行.NET

我现在已经解决了这个问题


第三方SOAP服务器被设计为以XML格式返回数据,嵌套在SOAP响应中。我现在用SimpleXML解析XML响应。

我的朋友,你发现问题了吗,我的wsdl也有同样的问题。
stdClass Object
(
    [strExampleCallResult] => stdClass Object
    (
        [any] => <Response xmlns="" release="1.0.0" environment="Production" lang="en-GB"><ApplicationArea><Sender><SenderId>0</SenderId><ReferenceId>0</ReferenceId></Sender><Destination><DestinationId>1</DestinationId></Destination></ApplicationArea><DataArea><Result>1</Result></DataArea></Response>
    )
)
echo $result->strExampleCallResult->Response->DataArea->Result;