繁体   English   中英

函数的 PHP 肥皂调用结果

[英]PHP soap call results from a function

我有一个带有返回结果的函数的 wsdl 文件

<s:element name="RecordDataResponse">
<s:complexType>
<s:sequence>
<s:element minOccurs="0" maxOccurs="1" name="RecordDataResult" type="s:string"/>
<s:element minOccurs="0" maxOccurs="1" name="message" type="s:string"/>
</s:sequence>
</s:complexType>
</s:element>

我试过这个,但提出了一个无效的函数结果..我只想从这个函数中获取值

$response2 = $soapclient->RecordDataResponse()->RecordDataResult;

但得到这个错误

Uncaught SoapFault exception: [Client] Function ("RecordDataResponse") is not a valid method for this service in ...

任何提示? 使用windows php,我可以将数据放入..

函数名称实际上是ImportData1 ,响应中可能存在也可能不存在属性RecordDataResult 所以这里是:

$responseObject = $soapclient->ImportData1(/* put parameters here if any */);
if (isset($responseObject -> RecordDataResult)) 
{
    $response2 = $responseObject -> RecordDataResult;
}
else
{
    $response2 = 'N/A'; // For example
};

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM