简体   繁体   English

函数的 PHP 肥皂调用结果

[英]PHP soap call results from a function

I have an wsdl file with a function that returns results我有一个带有返回结果的函数的 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>

I tried this but came up with an invalid function result.. i just want to get the value from this function我试过这个,但提出了一个无效的函数结果..我只想从这个函数中获取值

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

but get this error但得到这个错误

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

any hints?任何提示? using windows php and I can put data in ..使用windows php,我可以将数据放入..

The function name is actually ImportData1 and attribute RecordDataResult may or may not exist in the response.函数名称实际上是ImportData1 ,响应中可能存在也可能不存在属性RecordDataResult So here it is:所以这里是:

$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