dmitry          Fri Aug 31 10:48:45 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/soap/tests/bugs        bug42359.phpt bug42359.wsdl 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/soap   php_schema.c soap.c 
  Log:
  Fixed bug #42359 (xsd:list type not parsed)
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.919&r2=1.2027.2.547.2.920&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.919 php-src/NEWS:1.2027.2.547.2.920
--- php-src/NEWS:1.2027.2.547.2.919     Fri Aug 31 09:36:01 2007
+++ php-src/NEWS        Fri Aug 31 10:48:45 2007
@@ -7,6 +7,7 @@
   DOMElement). (Rob)
 - Fixed bug #42452 (PDO classes do not expose Reflection API information).
   (Hannes)
+- Fixed bug #42359 (xsd:list type not parsed). (Dmitry)
 - Fixed bug #42326 (SoapServer crash). (Dmitry)
 - Fixed bug #42086 (SoapServer return Procedure '' not present for WSIBasic
   compliant wsdl). (Dmitry)
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_schema.c?r1=1.58.2.6.2.5&r2=1.58.2.6.2.6&diff_format=u
Index: php-src/ext/soap/php_schema.c
diff -u php-src/ext/soap/php_schema.c:1.58.2.6.2.5 
php-src/ext/soap/php_schema.c:1.58.2.6.2.6
--- php-src/ext/soap/php_schema.c:1.58.2.6.2.5  Thu Feb 15 17:01:29 2007
+++ php-src/ext/soap/php_schema.c       Fri Aug 31 10:48:45 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_schema.c,v 1.58.2.6.2.5 2007/02/15 17:01:29 dmitry Exp $ */
+/* $Id: php_schema.c,v 1.58.2.6.2.6 2007/08/31 10:48:45 dmitry Exp $ */
 
 #include "php_soap.h"
 #include "libxml/uri.h"
@@ -453,7 +453,14 @@
                newType = emalloc(sizeof(sdlType));
                memset(newType, 0, sizeof(sdlType));
 
-               newType->name = estrdup("anonymous");
+               {
+                       smart_str anonymous = {0};
+                       
+                       smart_str_appendl(&anonymous, "anonymous", 
sizeof("anonymous")-1);
+                       smart_str_append_long(&anonymous, 
zend_hash_num_elements(sdl->types));
+                       smart_str_0(&anonymous);
+                       newType->name = anonymous.c;
+               }
                newType->namens = estrdup((char*)tns->children->content);
 
                if (cur_type->elements == NULL) {
@@ -463,6 +470,7 @@
                zend_hash_next_index_insert(cur_type->elements, &newType, 
sizeof(sdlTypePtr), (void **)&tmp);
 
                schema_simpleType(sdl, tns, trav, newType);
+
                trav = trav->next;
        }
        if (trav != NULL) {
@@ -541,7 +549,14 @@
                        newType = emalloc(sizeof(sdlType));
                        memset(newType, 0, sizeof(sdlType));
 
-                       newType->name = estrdup("anonymous");
+                       {
+                               smart_str anonymous = {0};
+                       
+                               smart_str_appendl(&anonymous, "anonymous", 
sizeof("anonymous")-1);
+                               smart_str_append_long(&anonymous, 
zend_hash_num_elements(sdl->types));
+                               smart_str_0(&anonymous);
+                               newType->name = anonymous.c;
+                       }
                        newType->namens = 
estrdup((char*)tns->children->content);
 
                        if (cur_type->elements == NULL) {
@@ -1879,7 +1894,14 @@
                        }
                        dummy_type = emalloc(sizeof(sdlType));
                        memset(dummy_type, 0, sizeof(sdlType));
-                       dummy_type->name = estrdup("anonymous");
+                       {
+                               smart_str anonymous = {0};
+                       
+                               smart_str_appendl(&anonymous, "anonymous", 
sizeof("anonymous")-1);
+                               smart_str_append_long(&anonymous, 
zend_hash_num_elements(sdl->types));
+                               smart_str_0(&anonymous);
+                               dummy_type->name = anonymous.c;
+                       }
                        dummy_type->namens = 
estrdup((char*)tns->children->content);
                        schema_simpleType(sdl, tns, trav, dummy_type);
                        newAttr->encode = dummy_type->encode;
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.28&r2=1.156.2.28.2.29&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.156.2.28.2.28 
php-src/ext/soap/soap.c:1.156.2.28.2.29
--- php-src/ext/soap/soap.c:1.156.2.28.2.28     Fri Aug 31 09:36:02 2007
+++ php-src/ext/soap/soap.c     Fri Aug 31 10:48:45 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: soap.c,v 1.156.2.28.2.28 2007/08/31 09:36:02 dmitry Exp $ */
+/* $Id: soap.c,v 1.156.2.28.2.29 2007/08/31 10:48:45 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -2878,8 +2878,8 @@
                        while (zend_hash_get_current_data_ex(sdl->types, (void 
**)&type, &pos) != FAILURE) {
                                type_to_string((*type), &buf, 0);
                                add_next_index_stringl(return_value, buf.c, 
buf.len, 1);
-                               zend_hash_move_forward_ex(sdl->types, &pos);
                                smart_str_free(&buf);
+                               zend_hash_move_forward_ex(sdl->types, &pos);
                        }
                }
        }
@@ -4546,8 +4546,6 @@
 
        switch (type->kind) {
                case XSD_TYPEKIND_SIMPLE:
-               case XSD_TYPEKIND_LIST:
-               case XSD_TYPEKIND_UNION:
                        if (type->encode) {
                                smart_str_appendl(buf, 
type->encode->details.type_str, strlen(type->encode->details.type_str));
                                smart_str_appendc(buf, ' ');
@@ -4556,6 +4554,40 @@
                        }
                        smart_str_appendl(buf, type->name, strlen(type->name));
                        break;
+               case XSD_TYPEKIND_LIST:
+                       smart_str_appendl(buf, "list ", 5);
+                       smart_str_appendl(buf, type->name, strlen(type->name));
+                       if (type->elements) {
+                               sdlTypePtr *item_type;
+
+                               smart_str_appendl(buf, " {", 2);
+                               
zend_hash_internal_pointer_reset_ex(type->elements, &pos);
+                               if 
(zend_hash_get_current_data_ex(type->elements, (void **)&item_type, &pos) != 
FAILURE) {
+                                       smart_str_appendl(buf, 
(*item_type)->name, strlen((*item_type)->name));
+                               }
+                               smart_str_appendc(buf, '}');
+                       }
+                       break;
+               case XSD_TYPEKIND_UNION:
+                       smart_str_appendl(buf, "union ", 6);
+                       smart_str_appendl(buf, type->name, strlen(type->name));
+                       if (type->elements) {
+                               sdlTypePtr *item_type;
+                               int first = 0;
+
+                               smart_str_appendl(buf, " {", 2);
+                               
zend_hash_internal_pointer_reset_ex(type->elements, &pos);
+                               while 
(zend_hash_get_current_data_ex(type->elements, (void **)&item_type, &pos) != 
FAILURE) {
+                                       if (!first) {
+                                               smart_str_appendc(buf, ',');
+                                               first = 0;
+                                       }
+                                       smart_str_appendl(buf, 
(*item_type)->name, strlen((*item_type)->name));
+                                       
zend_hash_move_forward_ex(type->elements, &pos);
+                               }
+                               smart_str_appendc(buf, '}');
+                       }
+                       break;
                case XSD_TYPEKIND_COMPLEX:
                case XSD_TYPEKIND_RESTRICTION:
                case XSD_TYPEKIND_EXTENSION:

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42359.phpt?view=markup&rev=1.1
Index: php-src/ext/soap/tests/bugs/bug42359.phpt
+++ php-src/ext/soap/tests/bugs/bug42359.phpt

http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/bugs/bug42359.wsdl?view=markup&rev=1.1
Index: php-src/ext/soap/tests/bugs/bug42359.wsdl
+++ php-src/ext/soap/tests/bugs/bug42359.wsdl

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to