]> granicus.if.org Git - php/commitdiff
Fixed bug #31832 (SOAP encoding problem with complex types in WSDL mode with multiple...
authorDmitry Stogov <dmitry@php.net>
Fri, 4 Feb 2005 15:42:27 +0000 (15:42 +0000)
committerDmitry Stogov <dmitry@php.net>
Fri, 4 Feb 2005 15:42:27 +0000 (15:42 +0000)
NEWS
ext/soap/soap.c

diff --git a/NEWS b/NEWS
index e97a70b47204cc00b69f172888059b29f861cfd5..f68d40f6f75b55e5858b528ca8c1c5a9893be99d 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,6 +17,8 @@ PHP                                                                        NEWS
   of true. (Tony)
 - Fixed bug #31842 (*date('r') does not return RFC2822 conforming date string).
   (Jani)
+- Fixed bug #31832 (SOAP encoding problem with complex types in WSDL mode with
+  multiple parts). (Dmitry)
 - Fixed bug #31797 (exif_read_data() uses too low nesting limit). (Ilia)
 - Fixed bug #31796 (readline completion handler does not handle empty return
   values). (Ilia)
index db4d4efcb8a4fe6b151fb4ff4b479866f0443818..e1efcb66d9f52edd639e9dc05c1107a3e64a9bb8 100644 (file)
@@ -3161,13 +3161,12 @@ static int serialize_response_call2(xmlNodePtr body, sdlFunctionPtr function, ch
 
                zend_hash_internal_pointer_reset_ex(Z_ARRVAL_P(ret), &pos);
                while (zend_hash_get_current_data_ex(Z_ARRVAL_P(ret), (void **)&data, &pos) != FAILURE) {
-                       char *param_name;
+                       char *param_name = NULL;
                        int   param_name_len;
-                       long  param_index;
+                       long  param_index = i;
 
                        zend_hash_get_current_key_ex(Z_ARRVAL_P(ret), &param_name, &param_name_len, &param_index, 0, &pos);
                        parameter = get_param(function, param_name, param_index, TRUE);
-
                        if (style == SOAP_RPC) {
                                param = serialize_parameter(parameter, *data, i, param_name, use, method TSRMLS_CC);
                        } else {
@@ -3788,6 +3787,16 @@ static sdlParamPtr get_param(sdlFunctionPtr function, char *param_name, int inde
        if (param_name != NULL) {
                if (zend_hash_find(ht, param_name, strlen(param_name), (void **)&tmp) != FAILURE) {
                        return *tmp;
+               } else {
+                       HashPosition pos;
+               
+                       zend_hash_internal_pointer_reset_ex(ht, &pos);
+                       while (zend_hash_get_current_data_ex(ht, (void **)&tmp, &pos) != FAILURE) {
+                               if ((*tmp)->paramName && strcmp(param_name, (*tmp)->paramName) == 0) {
+                                       return *tmp;
+                               }
+                               zend_hash_move_forward_ex(ht, &pos);
+                       }
                }
        } else {
                if (zend_hash_index_find(ht, index, (void **)&tmp) != FAILURE) {