Skip to content

Commit 6eb1155

Browse files
committed
ext/soap: Actually throw a SOAP Fault if the WSDL has disappeared
1 parent 78e50f5 commit 6eb1155

4 files changed

+8
-0
lines changed

ext/soap/soap.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1313,6 +1313,8 @@ PHP_METHOD(SoapServer, handle)
13131313
if (stream) {
13141314
php_stream_passthru(stream);
13151315
php_stream_close(stream);
1316+
} else {
1317+
soap_server_fault("Server", "Couldn't find WSDL", NULL, NULL, NULL);
13161318
}
13171319

13181320
SOAP_SERVER_END_CODE();

ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,3 +76,5 @@ $wsdlFile = __DIR__ . '/test_handle_non_existent_wsdl.wsdl';
7676
@unlink($wsdlFile);
7777
?>
7878
--EXPECT--
79+
<?xml version="1.0" encoding="UTF-8"?>
80+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Couldn't find WSDL</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query_disable_readfile.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,5 @@ $wsdlFile = __DIR__ . '/test_handle_non_existent_wsdl.wsdl';
8181
@unlink($wsdlFile);
8282
?>
8383
--EXPECT--
84+
<?xml version="1.0" encoding="UTF-8"?>
85+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Couldn't find WSDL</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

ext/soap/tests/SoapServer/handle_non_existing_WSDL_from_get_query_redefine_readfile.phpt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,3 +85,5 @@ $wsdlFile = __DIR__ . '/test_handle_non_existent_wsdl.wsdl';
8585
@unlink($wsdlFile);
8686
?>
8787
--EXPECT--
88+
<?xml version="1.0" encoding="UTF-8"?>
89+
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"><SOAP-ENV:Body><SOAP-ENV:Fault><faultcode>SOAP-ENV:Server</faultcode><faultstring>Couldn't find WSDL</faultstring></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

0 commit comments

Comments
 (0)