Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions ext/soap/soap.c
Original file line number Diff line number Diff line change
Expand Up @@ -3460,13 +3460,15 @@ static sdlFunctionPtr deserialize_function_call(sdlPtr sdl, xmlDocPtr request, c
}
}

if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
if (fnb->style == SOAP_RPC) {
if (func != NULL) {
if (function && function->binding && function->binding->bindingType == BINDING_SOAP) {
sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes;
if (fnb->style == SOAP_RPC) {
func = func->children;
}
} else {
func = func->children;
}
} else {
func = func->children;
}
deserialize_parameters(func, function, num_params, parameters);

Expand Down
33 changes: 33 additions & 0 deletions ext/soap/tests/empty_body_soapaction.phpt
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
--TEST--
SoapServer: empty Body with SOAPAction must not crash (RPC)
--EXTENSIONS--
soap
--INI--
soap.wsdl_cache_enabled=0
--SKIPIF--
<?php
if (php_sapi_name() == 'cli') echo 'skip non-CLI SAPI required for --POST-- / php://input';
?>
--POST--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>
--FILE--
<?php
class T {
function test() {
return 'ok';
}
}

$server = new SoapServer(__DIR__ . '/server025.wsdl', [
'cache_wsdl' => WSDL_CACHE_NONE,
]);
$server->setClass(T::class);
$_SERVER['HTTP_SOAPACTION'] = '"Test"';
$server->handle();
?>
--EXPECT--
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="http://testuri.org"><SOAP-ENV:Body><ns1:testResponse><result>ok</result></ns1:testResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
Loading