我正在尝试使用soap API。但我得到错误。 以下是wsdl文件。
https://www.shafafiya.org/v2/webservices.asmx?wsdl
以下是代码
try{
$c = new SoapClient("https://www.shafafiya.org/v2/webservices.asmx?wsdl", array("trace" => 1, "exceptions" => 0));
$x = $c->GetNewTransactions(array("login" => "username", "pwd" => "password"));
//execution fails from above line
SoapClient::__getLastResponseHeaders();
}catch(SoapFault $e){
var_dump($e);
}
输出$ x假设根据wsdl文件具有属性xmlTransactions
或至少具有erroerror
属性。我得到的实际上是一个NULL
object(SoapFault)#2 (9) {
["message":protected]=>
string(9) "Not Found"
["string":"Exception":private]=>
string(0) ""
["code":protected]=>
int(0)
["file":protected]=>
string(23) "/var/www/haad/index.php"
["line":protected]=>
int(6)
["trace":"Exception":private]=>
array(3) {
[0]=>
array(4) {
["function"]=>
string(11) "__doRequest"
["class"]=>
string(10) "SoapClient"
["type"]=>
string(2) "->"
["args"]=>
array(5) {
[0]=>
string(316) "<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="https://www.shafafiya.org/v2/"><SOAP-ENV:Body><ns1:GetNewTransactions><ns1:login>User</ns1:login><ns1:pwd>_PASS</ns1:pwd></ns1:GetNewTransactions></SOAP-ENV:Body></SOAP-ENV:Envelope>
"
[1]=>
string(44) "http://www.shafafiya.org/v2/webservices.asmx"
[2]=>
string(47) "https://www.shafafiya.org/v2/GetNewTransactions"
[3]=>
int(1)
[4]=>
int(0)
}
}
[1]=>
array(6) {
["file"]=>
string(23) "/var/www/haad/index.php"
["line"]=>
int(6)
["function"]=>
string(6) "__call"
["class"]=>
string(10) "SoapClient"
["type"]=>
string(2) "->"
["args"]=>
array(2) {
[0]=>
string(18) "GetNewTransactions"
[1]=>
array(1) {
[0]=>
array(2) {
["login"]=>
string(6) "user"
["pwd"]=>
string(8) "PASS"
}
}
}
}
[2]=>
array(6) {
["file"]=>
string(23) "/var/www/haad/index.php"
["line"]=>
int(6)
["function"]=>
string(18) "GetNewTransactions"
["class"]=>
string(10) "SoapClient"
["type"]=>
string(2) "->"
["args"]=>
array(1) {
[0]=>
array(2) {
["login"]=>
string(6) "User"
["pwd"]=>
string(8) "pass"
}
}
}
}
["previous":"Exception":private]=>
NULL
["faultstring"]=>
string(9) "Not Found"
["faultcode"]=>
string(4) "HTTP"
}
api似乎与其他语言一起使用
任何想法
谢谢