I'm trying to build a web service by PHP.
In my case, I called the getINFO(), but the return value on client side always null.
Have no idea to solve this problem..
Here's the SOAPserver code(WS.WEB_s.php):
require("WEB_s.php");
ini_set("soap.wsdl_cache_enabled", 0);
$server = new SoapServer('wsdl/WEB_s.wsdl');
$server->setClass("WEB_s");
$server->handle();
Where the main Class is(WEB_s.php):
final class WEB_s {
public function getINFO(){
$JsonOutput = '{"key":"value",...}';
return $JsonOutput;
}
public function setWAN($setCommand,$newConfigfilePath){
$bOutput;
return $bOutput;
}
}
And Client side:
$(document).ready(function(){
$('#qqq').button().click(function(){
var soapMessage = LoginSoap($('#uid').val(),$('#pwd').val());
alert('soapMessage');
$.ajax({
//url: 'libraries/WS.WEB_s.php/WEB_s/getINFO',//success , return null
//url: 'libraries/WS.WEB_s.php/', //success , return null
url: 'libraries/WS.WEB_s.php/getINFO',//success , return null
type: 'GET',
timeout: (10* 1000),
contentType: "text/xml",
dataType: "xml",
success: function( data,textStatus,jqXHR){
alert('Server success(' + data+')('+ textStatus + ')(' + jqXHR + ')');
},
error: function (request, status, error) {
alert('Server Error(' + status+')->'+error);
},
complete: function (jqXHR, textStatus) {
alert('Server success(' + jqXHR+')('+ textStatus + ')');
}
});
});
});
The following is the corresponding WSDL file :
http://codepaste.net/95wq9b