簡體   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