Undefined property: stdClass::$GetDataResult Error message

雨燕双飞 提交于 2019-12-24 20:20:08

问题


I'm Using PHP Soap Client function to connect Remote service using this code

try
{
    $result = $soapClient->GetData($parameters);
}
catch (SoapFault $fault)
{
    echo "Fault code: {$fault->faultcode}" . NEWLINE;
    echo "Fault string: {$fault->faultstring}" . NEWLINE;
    if ($soapClient != null)
    {
        $soapClient = null;
    }
    exit();
}
$soapClient = null;

Finally I'm calling this function,

echo "Return value: {$result->GetDataResult}" . NEWLINE;

But It's not working for me and got warning message like this.

Notice: Undefined property: stdClass::$GetDataResult

回答1:


You are ASSUMING that the response comes as an object with the property "GetDataResult". What makes you think so? This is not the case, and that's why you get this error message.

Dump the content of $result to see what you really get. You can also look at the WSDL file to see what the service promises to respond with.



来源:https://stackoverflow.com/questions/13874335/undefined-property-stdclassgetdataresult-error-message

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!