dmitry          Tue Mar 20 09:52:14 2007 UTC

  Added files:                 (Branch: PHP_5_2)
    /php-src/ext/soap/tests/schema      schema081.phpt schema082.phpt 
                                        schema083.phpt schema084.phpt 

  Modified files:              
    /php-src    NEWS 
    /php-src/ext/soap   php_encoding.c php_soap.h soap.c 
    /php-src/ext/soap/tests/interop/Round2/Base r2_base_009s.phpt 
    /php-src/ext/soap/tests/schema      test_schema.inc 
  Log:
  Added ability to encode arrays with "SOAP-ENC:Array" type instead of WSDL 
type. To activate the ability use "feature"=>SOAP_USE_XSI_ARRAY_TYPE option in 
SoapClient/SoapServer constructors.
  
  
http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.604&r2=1.2027.2.547.2.605&diff_format=u
Index: php-src/NEWS
diff -u php-src/NEWS:1.2027.2.547.2.604 php-src/NEWS:1.2027.2.547.2.605
--- php-src/NEWS:1.2027.2.547.2.604     Tue Mar 20 07:51:31 2007
+++ php-src/NEWS        Tue Mar 20 09:52:13 2007
@@ -14,6 +14,10 @@
 - Improved SPL (Marcus)
   . Added SplFileInfo::getBasename(), DirectoryIterator::getBasename().
   . Added SplFileInfo::getLinkTarget(), SplFileInfo::getRealPath().
+- Improved SOAP
+  . Added ability to encode arrays with "SOAP-ENC:Array" type instead of WSDL
+    type. To activate the ability use "feature"=>SOAP_USE_XSI_ARRAY_TYPE
+    option in SoapClient/SoapServer constructors. (Rob, Dmitry)
 - Added --ri switch to CLI which allows to check extension information. 
(Marcus)
 - Added tidyNode::getParent() method (John, Nuno)
 - Added openbasedir and safemode checks in zip:// stream wrapper and 
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_encoding.c?r1=1.103.2.21.2.25&r2=1.103.2.21.2.26&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.25 
php-src/ext/soap/php_encoding.c:1.103.2.21.2.26
--- php-src/ext/soap/php_encoding.c:1.103.2.21.2.25     Tue Mar 20 07:51:31 2007
+++ php-src/ext/soap/php_encoding.c     Tue Mar 20 09:52:13 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_encoding.c,v 1.103.2.21.2.25 2007/03/20 07:51:31 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.103.2.21.2.26 2007/03/20 09:52:13 dmitry Exp $ */
 
 #include <time.h>
 
@@ -1655,6 +1655,7 @@
                xmlAddChild(parent, xmlParam);
                if (style == SOAP_ENCODED) {
                        set_xsi_nil(xmlParam);
+                       set_ns_and_type(xmlParam, type);
                }
                return xmlParam;
        }
@@ -2047,7 +2048,17 @@
        xmlParam = xmlNewNode(NULL, BAD_CAST("BOGUS"));
        xmlAddChild(parent, xmlParam);
 
-       FIND_ZVAL_NULL(data, xmlParam, style);
+       if (!data || Z_TYPE_P(data) == IS_NULL) {
+               if (style == SOAP_ENCODED) {
+                       set_xsi_nil(xmlParam);
+                       if (SOAP_GLOBAL(features) & SOAP_USE_XSI_ARRAY_TYPE) {
+                               set_ns_and_type_ex(xmlParam, (soap_version == 
SOAP_1_1) ? SOAP_1_1_ENC_NAMESPACE : SOAP_1_2_ENC_NAMESPACE, "Array");
+                       } else {
+                               set_ns_and_type(xmlParam, type);
+                       }
+               }
+               return xmlParam;
+       }
 
        if (Z_TYPE_P(data) == IS_ARRAY) {
                sdlAttributePtr *arrayType;
@@ -2220,7 +2231,11 @@
                efree(dims);
        }
        if (style == SOAP_ENCODED) {
-               set_ns_and_type(xmlParam, type);
+               if (SOAP_GLOBAL(features) & SOAP_USE_XSI_ARRAY_TYPE) {
+                       set_ns_and_type_ex(xmlParam, (soap_version == SOAP_1_1) 
? SOAP_1_1_ENC_NAMESPACE : SOAP_1_2_ENC_NAMESPACE, "Array");
+               } else {
+                       set_ns_and_type(xmlParam, type);
+               }
        }
        return xmlParam;
 }
@@ -3026,9 +3041,9 @@
                        if (type->encode &&
                            (type->encode->details.type == IS_ARRAY ||
                             type->encode->details.type == SOAP_ENC_ARRAY)) {
-                               ret = to_xml_array(enc, data, style, parent);
+                               return to_xml_array(enc, data, style, parent);
                        } else {
-                               ret = to_xml_object(enc, data, style, parent);
+                               return to_xml_object(enc, data, style, parent);
                        }
                        break;
                default:
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/php_soap.h?r1=1.38.2.6.2.3&r2=1.38.2.6.2.4&diff_format=u
Index: php-src/ext/soap/php_soap.h
diff -u php-src/ext/soap/php_soap.h:1.38.2.6.2.3 
php-src/ext/soap/php_soap.h:1.38.2.6.2.4
--- php-src/ext/soap/php_soap.h:1.38.2.6.2.3    Mon Jan  1 09:36:06 2007
+++ php-src/ext/soap/php_soap.h Tue Mar 20 09:52:13 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_soap.h,v 1.38.2.6.2.3 2007/01/01 09:36:06 sebastian Exp $ */
+/* $Id: php_soap.h,v 1.38.2.6.2.4 2007/03/20 09:52:13 dmitry Exp $ */
 
 #ifndef PHP_SOAP_H
 #define PHP_SOAP_H
@@ -140,7 +140,8 @@
 #define SOAP_AUTHENTICATION_DIGEST  1
 
 #define SOAP_SINGLE_ELEMENT_ARRAYS  (1<<0)
-#define SOAP_WAIT_ONE_WAY_CALLS     (2<<0)
+#define SOAP_WAIT_ONE_WAY_CALLS     (1<<1)
+#define SOAP_USE_XSI_ARRAY_TYPE     (1<<2)
 
 #define WSDL_CACHE_NONE     0x0
 #define WSDL_CACHE_DISK     0x1
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/soap.c?r1=1.156.2.28.2.20&r2=1.156.2.28.2.21&diff_format=u
Index: php-src/ext/soap/soap.c
diff -u php-src/ext/soap/soap.c:1.156.2.28.2.20 
php-src/ext/soap/soap.c:1.156.2.28.2.21
--- php-src/ext/soap/soap.c:1.156.2.28.2.20     Tue Feb 27 03:04:40 2007
+++ php-src/ext/soap/soap.c     Tue Mar 20 09:52:13 2007
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: soap.c,v 1.156.2.28.2.20 2007/02/27 03:04:40 iliaa Exp $ */
+/* $Id: soap.c,v 1.156.2.28.2.21 2007/03/20 09:52:13 dmitry Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -663,6 +663,7 @@
 
        REGISTER_LONG_CONSTANT("SOAP_SINGLE_ELEMENT_ARRAYS", 
SOAP_SINGLE_ELEMENT_ARRAYS, CONST_CS | CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("SOAP_WAIT_ONE_WAY_CALLS", 
SOAP_WAIT_ONE_WAY_CALLS, CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("SOAP_USE_XSI_ARRAY_TYPE", 
SOAP_USE_XSI_ARRAY_TYPE, CONST_CS | CONST_PERSISTENT);
 
        REGISTER_LONG_CONSTANT("WSDL_CACHE_NONE",   WSDL_CACHE_NONE,   CONST_CS 
| CONST_PERSISTENT);
        REGISTER_LONG_CONSTANT("WSDL_CACHE_DISK",   WSDL_CACHE_DISK,   CONST_CS 
| CONST_PERSISTENT);
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt?r1=1.1.2.1.2.1&r2=1.1.2.1.2.2&diff_format=u
Index: php-src/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt
diff -u 
php-src/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt:1.1.2.1.2.1 
php-src/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt:1.1.2.1.2.2
--- php-src/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt:1.1.2.1.2.1    
Fri May 26 09:02:34 2006
+++ php-src/ext/soap/tests/interop/Round2/Base/r2_base_009s.phpt        Tue Mar 
20 09:52:13 2007
@@ -14,7 +14,7 @@
 ?>
 --EXPECT--
 <?xml version="1.0" encoding="UTF-8"?>
-<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://soapinterop.org/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ns2="http://soapinterop.org/xsd"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray
 xsi:nil="true" 
xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
+<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://soapinterop.org/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
xmlns:ns2="http://soapinterop.org/xsd"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body><ns1:echoStringArray><inputStringArray
 xsi:nil="true" 
xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArray></SOAP-ENV:Body></SOAP-ENV:Envelope>
 <?xml version="1.0" encoding="UTF-8"?>
 <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"; 
xmlns:ns1="http://soapinterop.org/"; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
xmlns:ns2="http://soapinterop.org/xsd"; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema"; 
xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/"; 
SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/";><SOAP-ENV:Body><ns1:echoStringArrayResponse><outputStringArray
 xsi:nil="true" 
xsi:type="ns2:ArrayOfstring"/></ns1:echoStringArrayResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
 ok
http://cvs.php.net/viewvc.cgi/php-src/ext/soap/tests/schema/test_schema.inc?r1=1.9&r2=1.9.4.1&diff_format=u
Index: php-src/ext/soap/tests/schema/test_schema.inc
diff -u php-src/ext/soap/tests/schema/test_schema.inc:1.9 
php-src/ext/soap/tests/schema/test_schema.inc:1.9.4.1
--- php-src/ext/soap/tests/schema/test_schema.inc:1.9   Sun Apr  3 15:39:56 2005
+++ php-src/ext/soap/tests/schema/test_schema.inc       Tue Mar 20 09:52:14 2007
@@ -6,7 +6,7 @@
        $val = $input;
 }
 
-function test_schema($schema,$type,$param,$style="rpc",$use="encoded", 
$attributeFormDefault='') {
+function test_schema($schema,$type,$param,$style="rpc",$use="encoded", 
$attributeFormDefault='',$features=0) {
   global $HTTP_RAW_POST_DATA, $val;
 $wsdl  = <<<EOF
 <definitions name="InteropTest"
@@ -55,8 +55,8 @@
   fwrite($f,$wsdl);
   fclose($f);
   ini_set("soap.wsdl_cache_enabled",0);
-  $x = new SoapClient($fname, array("trace"=>1,"exceptions"=>0));
-  $y = new SoapServer($fname);
+  $x = new SoapClient($fname, 
array("trace"=>1,"exceptions"=>0,"features"=>$features));
+  $y = new SoapServer($fname, array("features"=>$features));
        $y->addfunction("test");
   unlink($fname);
 

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

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

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

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

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

Reply via email to