当我尝试用php概述soap时出错


Error when i try to overview soap with php

你好,我在soap中有一些请求,但是当我在我的网站中尝试请求时,我有一些错误。

致命错误:在/home/loraclecc/public_html/pick5.php中的非对象上调用成员函数Body()

请求:

<?php
/** define the SOAP client using the url for the service**/
$SoapiClient = new soapclient('http://14.141.212.201/ConRsltAPI/Result.asmx?WSDL', array('trace' => 1));
$lStrCred = "GI2304CON15";
$lStrGameName = "PICK3";
$lstrStatus = "0";
$thearray = array(
    'lStrCred' => $lStrCred,
    'lStrGameName' => $lStrGameName, 
    'lstrStatus' => $lstrStatus
);
$result = $client->Body($thearray);
if (is_soap_fault($result)):
    echo '<h1>ERRROR</h1><pre>';
    print_r($result);
    echo '</pre>';
else:
    echo '<h1>Working FINE</h1><pre>';
    print_r($result);
    echo '</pre>';
endif;
// see the last SOAP request
echo htmlspecialchars($client->__getLastRequest(), ENT_QUOTES);
// print the SOAP response
echo htmlspecialchars($client->__getLastResponse(), ENT_QUOTES);
/** lets store the login token just in case we want to use it for later use**/
$token = $result->token;
?>

$client在第14行不存在。变化:

$result = $client->Body($thearray);

$result = $SoapiClient->Body($thearray);