0

i have a soap with a method that return nothing

class mySoapService {
   foo(){

   }
}

$wsdl = ...;

$soapService = new mySoapService();

$soapServer = new \SoapServer($wsdl);
$soapServer->setObject($soapService);
$soapServer->handle(); // write nothing on call foo

some soap client raise an exception because they expect a proper xml-soap empty response, like this:

<?xml version="1.0"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/">
    <SOAP-ENV:Body SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
    </SOAP-ENV:Body>
</SOAP-ENV:Envelope>

the questions are:

  1. why PHP SoapServer return an empty response and not a xml-soap empty response?

  2. what say the soap standard for method without return a value?

ar099968
  • 6,963
  • 12
  • 64
  • 127

1 Answers1

0

Changing

$soapServer->handle();

to

$soapServer->handle(file_get_contents("php://input"));

worked for me

Ruben Benjamin
  • 707
  • 9
  • 9