Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/heroku/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用php在API中调用请求_Php_Api_Soap_Soap Client - Fatal编程技术网

使用php在API中调用请求

使用php在API中调用请求,php,api,soap,soap-client,Php,Api,Soap,Soap Client,我试图使用下面的方法调用API中的函数,但我不确定我做错了什么 $wcfClient = new SoapClient('http://apisite.com/FlighSearch.svc?wsdl'); $postData=array( 'username'=>'username', 'password'=>'password' ); $response = $wcfClient->UserAuthentication($postData); echo $response-

我试图使用下面的方法调用API中的函数,但我不确定我做错了什么

$wcfClient = new SoapClient('http://apisite.com/FlighSearch.svc?wsdl');
$postData=array(
'username'=>'username',
'password'=>'password'
);
$response = $wcfClient->UserAuthentication($postData);
echo $response->UserAuthenticationResult;
我得到的结果是: 认证成功 它的平均API连接正常。现在我这样调用函数:

$response_final = $wcfClient->SearchFareReturnFlight('U',"5HB","12/12/2015","12/30/2015",1,"LHR","HKG","username","password");

echo $response_final
但是它对我不起作用。你能检查一下有什么问题吗