when i run url https://localhost/NewApp/sms/test?wsdl to show xml in file wsdl , return null. Then I write file test.php in folder public and run https://localhost/test.php?wsdl . it return xml in file smssoap.wsdl This is my code :
public function testAction()
{
ini_set("soap.wsdl_cache_enabled", "0");
$soapServer = new \SoapServer('smssoap.wsdl', ["soap _version" => SOAP_1_2]);
$soapServer->setObject($this);
$soapServer->handle();
}
file test.php
<?php
class SmsSoapController{
public function executeReceiveMO(){
error_reporting(E_ALL);
ini_set('display_errors', 1);
ini_set("soap.wsdl_cache_enabled", "0"); // disabling WSDL cache
$soap_server = new SoapServer('smssoap.wsdl',array('soap_version' => SOAP_1_2));
$soap_server->setObject($this);
$soap_server->handle();
exit();
}
}
$soap = new SmsSoapController();
$soap->executeReceiveMO();
?>