PHP SOAP server does not return value at all

This is an urgent problem that did not work after working on it for several days.

http://www.tabernus.com/ws/soap/server.php?WSDL should provide you with a WSDL file.

Inside server.php, I wanted to return an incremental serial number when calling the GetAuditInformation method.

So, I wrote this simple function on top:

 <?php 
 function GetAuditInformation($serialNumber) {
 $serialNumber=$serialNumber +1;
 return $serialNumber;        
 }

 ini_set("soap.wsdl_cache_enabled", "0");
 $server = new SoapServer('wsMRMAudit.wsdl');
 $server->addFunction("GetAuditInformation"); 
 $server->handle();

?>

I tested using SOAPtester using plumvoice and it was able to get methods via WSDL.

http://www.plumvoice.com/soaptester/

But enter the serial number, say ... 1000, and it should return 1001, but it returns NULL. Why is this?

+3
source share
1 answer

, , , . :

function GetAuditInformation($x)
{
    return array('GetAuditInformationResult' => $x->SerialNumber + 1);
}

script, btw:

$s = new SoapClient('http://www.tabernus.com/ws/soap/server.php?WSDL', array('trace'=>true));

var_dump($s->GetAuditInformation(array('SerialNumber' => 1000)));

$req = $s->__getLastRequest();

function GetAuditInformation($x)
{
return array('GetAuditInformationResult' => $x->SerialNumber + 1);
}

$server = new SoapServer('http://www.tabernus.com/ws/soap/server.php?WSDL', array(
    'actor' => 'http://www.tabernus.com/ws/soap/',
    'soap_version' => SOAP_1_2
));
$server->addFunction('GetAuditInformation');

$server->handle($req);
+3

All Articles