Javascript SOAP-PHP和angular
我正在尝试使用PHP文件中使用的SOAP Web服务 当我直接访问PHP文件时,它就工作了。() 当我尝试从AngularJS访问它时,如下所示:Javascript SOAP-PHP和angular,javascript,php,angularjs,soap,Javascript,Php,Angularjs,Soap,我正在尝试使用PHP文件中使用的SOAP Web服务 当我直接访问PHP文件时,它就工作了。() 当我尝试从AngularJS访问它时,如下所示: function loadwsffbad() { var players={} var urlphp="http://localhost/cordova/mbacly/www/php/"; $http.get(urlphp+"getffbadsample.php").then(function(data) { play
function loadwsffbad() {
var players={}
var urlphp="http://localhost/cordova/mbacly/www/php/";
$http.get(urlphp+"getffbadsample.php").then(function(data) {
players = data.data;
console.log(players);
},function(status) {
alert("pas d accès réseau");
});
}
我在控制台中看到:
Fatal error: Class 'SoapClient' not found in C:\wamp\www\cordova\mbacly\www\php\getffbadsample.php on line 5
我在其他帖子中看到,我需要检查服务器上是否启用了SOAP,这是case(),因为它直接与php文件一起工作,我猜它不是pb
getffbadsample.php:
<?php
$clientSOAP = new SoapClient('http://ws.ffbad.com/FFBAD-WS.wsdl');
$Auth["Login"]="******";
$Auth["Password"]="*****";
//Encodage de vos identifiants en Json (sérialisation des objets)
$AuthJson = json_encode($Auth);
$Query["Function"]="ws_getresultbylicence";
$Query["Param"]["Licence"]="06468814";
$QueryJson = json_encode($Query);
//Appel de la fonction distante
$Return = $clientSOAP->getResult($QueryJson,$AuthJson);
echo $Return;
?>
感谢您的帮助。需要对您的数据进行json_encode()。javascript无法读取php
stdClass对象
@charlietfl l删除了json_解码,因此现在我从直接调用中获得了一些json数据。(请参见编辑)。我从javascript调用中得到了相同的错误