我有一个肥皂,它的方法什么也不返回
class mySoapService {
foo(){
}
}
$wsdl = ...;
$soapService = new mySoapService();
$soapServer = new \SoapServer($wsdl);
$soapServer->setObject($soapService);
$soapServer->handle(); // write nothing on call foo
一些肥皂客户端引发异常,因为他们期望正确的xml-soap空响应,如下所示:
<?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>
问题是:
为什么PHP SoapServer返回空响应而不是xml-soap空响应?
怎么说肥皂标准而不返回值?
答案 0 :(得分:0)
更改
$soapServer->handle();
到
$soapServer->handle(file_get_contents("php://input"));
为我工作