From: Dmitry Stogov Date: Fri, 31 Aug 2007 09:36:02 +0000 (+0000) Subject: Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant... X-Git-Tag: RELEASE_1_2_4~11 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fdf96bed473466d398dc2da6b6d39731074da710;p=php Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl) --- diff --git a/NEWS b/NEWS index 0546cc0f33..063e27ed5c 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ PHP NEWS - Fixed bug #42452 (PDO classes do not expose Reflection API information). (Hannes) - Fixed bug #42326 (SoapServer crash). (Dmitry) +- Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic + compliant wsdl). (Dmitry) 30 Aug 2007, PHP 5.2.4 - Removed --enable-versioning configure option. (Jani) diff --git a/ext/soap/soap.c b/ext/soap/soap.c index 1eb3abe638..a27626110e 100644 --- a/ext/soap/soap.c +++ b/ext/soap/soap.c @@ -3248,7 +3248,17 @@ static void deserialize_parameters(xmlNodePtr params, sdlFunctionPtr function, i } trav = trav->next; } - if (num_of_params > 0) { + + if (num_of_params == 1 && + function && + function->binding && + function->binding->bindingType == BINDING_SOAP && + ((sdlSoapBindingFunctionPtr)function->bindingAttributes)->style == SOAP_DOCUMENT && + (function->requestParameters == NULL || + zend_hash_num_elements(function->requestParameters) == 0) && + strcmp(params->name, function->functionName) == 0) { + num_of_params = 0; + } else if (num_of_params > 0) { tmp_parameters = safe_emalloc(num_of_params, sizeof(zval *), 0); trav = params; @@ -3289,7 +3299,11 @@ static sdlFunctionPtr find_function(sdlPtr sdl, xmlNodePtr func, zval* function_ if (function && function->binding && function->binding->bindingType == BINDING_SOAP) { sdlSoapBindingFunctionPtr fnb = (sdlSoapBindingFunctionPtr)function->bindingAttributes; if (fnb->style == SOAP_DOCUMENT) { - function = NULL; + if (func->children != NULL || + (function->requestParameters != NULL && + zend_hash_num_elements(function->requestParameters) > 0)) { + function = NULL; + } } } if (sdl != NULL && function == NULL) { diff --git a/ext/soap/tests/bugs/bug42086.phpt b/ext/soap/tests/bugs/bug42086.phpt new file mode 100755 index 0000000000..6edc06f879 --- /dev/null +++ b/ext/soap/tests/bugs/bug42086.phpt @@ -0,0 +1,31 @@ +--TEST-- +Bug #42086 (SoapServer return Procedure '' not present for WSIBasic compliant wsdl) +--SKIPIF-- + +--INI-- +soap.wsdl_cache_enabled=0 +--FILE-- + + +EOF; + +class firstFunctionWithoutParamResponse { + public $param; +} + +function firstFunctionWithoutParam() { + $ret = new firstFunctionWithoutParamResponse(); + $ret->param = "firstFunctionWithoutParam"; + return $ret; +} + +$server = new SoapServer(dirname(__FILE__).'/bug42086.wsdl', + array('features'=>SOAP_SINGLE_ELEMENT_ARRAYS)); +$server->addFunction('firstFunctionWithoutParam'); +$server->handle($request); +?> +--EXPECT-- + +firstFunctionWithoutParam diff --git a/ext/soap/tests/bugs/bug42086.wsdl b/ext/soap/tests/bugs/bug42086.wsdl new file mode 100755 index 0000000000..5ec3d956ca --- /dev/null +++ b/ext/soap/tests/bugs/bug42086.wsdl @@ -0,0 +1,141 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Enter description here... + + + + + + + Enter description here... + + + + + + + Enter description here... + + + + + + + Enter description here... + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +