PHP/SOAP - 如何使用 SOAP 创建工作请求
PHP/SOAP - How to create working request with SOAP
这是我在 SoapUI 中的请求:
我使用 SoapUI 发送请求并收到良好的响应。
这是我目前的 PHP 代码:
<?PHP
$wsdl = 'https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx';
try{
$clinet=new SoapClient($wsdl);
$ver =array(
"UserName"=>"USERNAME",
"Password"=>"PASSWORD",
"ApiKey"=>"APIKEYHERE",
"Date"=>"2017-11-09",
);
$quates=$clinet->GetAddedBalanceList($ver);
var_dump($quates);
}
catch(SoapFault $e)
{
echo $e->getMessage();
}
当我执行我收到的代码时:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx' : Premature end of data in tag html line 3
不知何故我做错了什么。我不太确定我的 PHP 请求是否正确。
我的错误在哪里,正确的请求应该是什么样的?
对于像 "Premature end of data in tag html" 这样的 SoapClient 错误,您的 link 到 WSDL 文件通常是不正确的。
试试这个:https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx?WSDL
这是我在 SoapUI 中的请求:
我使用 SoapUI 发送请求并收到良好的响应。
这是我目前的 PHP 代码:
<?PHP
$wsdl = 'https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx';
try{
$clinet=new SoapClient($wsdl);
$ver =array(
"UserName"=>"USERNAME",
"Password"=>"PASSWORD",
"ApiKey"=>"APIKEYHERE",
"Date"=>"2017-11-09",
);
$quates=$clinet->GetAddedBalanceList($ver);
var_dump($quates);
}
catch(SoapFault $e)
{
echo $e->getMessage();
}
当我执行我收到的代码时:
SOAP-ERROR: Parsing WSDL: Couldn't load from 'https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx' : Premature end of data in tag html line 3
不知何故我做错了什么。我不太确定我的 PHP 请求是否正确。
我的错误在哪里,正确的请求应该是什么样的?
对于像 "Premature end of data in tag html" 这样的 SoapClient 错误,您的 link 到 WSDL 文件通常是不正确的。
试试这个:https://onlinefatura.xyz/foyws/FoyOnlineApiGateWS.asmx?WSDL