dmitry          Thu Oct 16 15:36:59 2008 UTC

  Modified files:              (Branch: PHP_5_3)
    /php-src/ext/soap   php_encoding.c 
  Log:
  Fixed bug #43723 (SOAP not sent properly from client for <choice>)
  
  
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.37.2.7&r2=1.103.2.21.2.37.2.8&diff_format=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.7 
php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.8
--- php-src/ext/soap/php_encoding.c:1.103.2.21.2.37.2.7 Wed Oct  1 08:42:48 2008
+++ php-src/ext/soap/php_encoding.c     Thu Oct 16 15:36:59 2008
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_encoding.c,v 1.103.2.21.2.37.2.7 2008/10/01 08:42:48 dmitry Exp $ 
*/
+/* $Id: php_encoding.c,v 1.103.2.21.2.37.2.8 2008/10/16 15:36:59 dmitry Exp $ 
*/
 
 #include <time.h>
 
@@ -361,6 +361,7 @@
 static xmlNodePtr master_to_xml_int(encodePtr encode, zval *data, int style, 
xmlNodePtr parent, int check_class_map)
 {
        xmlNodePtr node = NULL;
+       int add_type = 0;
        TSRMLS_FETCH();
 
        /* Special handling of class SoapVar */
@@ -451,14 +452,15 @@
                                encodePtr enc = NULL;
                                if (SOAP_GLOBAL(sdl)) {
                                        enc = get_encoder(SOAP_GLOBAL(sdl), 
SOAP_GLOBAL(sdl)->target_ns, type_name);
+                                       if (!enc) {
+                                                       enc = 
find_encoder_by_type_name(SOAP_GLOBAL(sdl), type_name);
+                                               }
                                }
                                if (enc) {
+                                       if (encode != enc && style == 
SOAP_LITERAL) {
+                                                       add_type = 1;           
                                
+                                       }
                                        encode = enc;
-                                       } else if (SOAP_GLOBAL(sdl)) {
-                                               enc = 
find_encoder_by_type_name(SOAP_GLOBAL(sdl), type_name);
-                                       if (enc) {
-                                               encode = enc;
-                                       }
                                        }
                                break;
                                }
@@ -485,6 +487,9 @@
                }
                if (encode->to_xml) {
                        node = encode->to_xml(&encode->details, data, style, 
parent);
+                       if (add_type) {
+                               set_ns_and_type(node, &encode->details);
+                       }
                }
        }
        return node;
@@ -1662,6 +1667,13 @@
                        encodePtr enc;
 
                        data = get_zval_property(object, model->u.element->name 
TSRMLS_CC);
+                       if (data &&
+                           Z_TYPE_P(data) == IS_NULL &&
+                           !model->u.element->nillable &&
+                           model->min_occurs > 0 &&
+                           !strict) {
+                               return 0;
+                       }
                        if (data) {
                                enc = model->u.element->encode;
                                if ((model->max_occurs == -1 || 
model->max_occurs > 1) &&



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

Reply via email to