dmitry          Tue Nov  1 06:11:19 2005 EDT

  Added files:                 
    /php-src/ext/soap/tests     any.phpt 

  Modified files:              
    /php-src/ext/soap   php_encoding.c 
    /php-src/ext/soap/tests/bugs        bug34449.phpt 
  Log:
  Fixed SIGSEGV
  
  
http://cvs.php.net/diff.php/php-src/ext/soap/php_encoding.c?r1=1.113&r2=1.114&ty=u
Index: php-src/ext/soap/php_encoding.c
diff -u php-src/ext/soap/php_encoding.c:1.113 
php-src/ext/soap/php_encoding.c:1.114
--- php-src/ext/soap/php_encoding.c:1.113       Tue Oct 11 06:16:03 2005
+++ php-src/ext/soap/php_encoding.c     Tue Nov  1 06:11:17 2005
@@ -17,7 +17,7 @@
   |          Dmitry Stogov <[EMAIL PROTECTED]>                             |
   +----------------------------------------------------------------------+
 */
-/* $Id: php_encoding.c,v 1.113 2005/10/11 10:16:03 dmitry Exp $ */
+/* $Id: php_encoding.c,v 1.114 2005/11/01 11:11:17 dmitry Exp $ */
 
 #include <time.h>
 
@@ -2766,7 +2766,7 @@
 
                zval_copy_ctor(&tmp);
                convert_to_string(&tmp);
-               ret = xmlNewTextLen(Z_STRVAL_P(data), Z_STRLEN_P(data));
+               ret = xmlNewTextLen(Z_STRVAL(tmp), Z_STRLEN(tmp));
                zval_dtor(&tmp);
        }
        ret->name = xmlStringTextNoenc;
http://cvs.php.net/diff.php/php-src/ext/soap/tests/bugs/bug34449.phpt?r1=1.1&r2=1.2&ty=u
Index: php-src/ext/soap/tests/bugs/bug34449.phpt
diff -u php-src/ext/soap/tests/bugs/bug34449.phpt:1.1 
php-src/ext/soap/tests/bugs/bug34449.phpt:1.2
--- php-src/ext/soap/tests/bugs/bug34449.phpt:1.1       Mon Sep 12 04:23:49 2005
+++ php-src/ext/soap/tests/bugs/bug34449.phpt   Tue Nov  1 06:11:19 2005
@@ -1,5 +1,7 @@
 --TEST--
 Bug #34449 (ext/soap: XSD_ANYXML functionality not exposed)
+--SKIPIF--
+<?php require_once('skipif.inc'); ?>
 --FILE--
 <?php
 class TestSoapClient extends SoapClient {

http://cvs.php.net/co.php/php-src/ext/soap/tests/any.phpt?r=1.1&p=1
Index: php-src/ext/soap/tests/any.phpt
+++ php-src/ext/soap/tests/any.phpt
--TEST--
SOAP handling of <any>
--SKIPIF--
<?php require_once('skipif.inc'); ?>
--FILE--
<?php
class SOAPComplexType {
    function SOAPComplexType($s, $i, $f) {
        $this->varString = $s;
        $this->varInt = $i;
        $this->varFloat = $f;
    }
}
$struct = new SOAPComplexType('arg',34,325.325);

function echoAnyElement($x) {
        global $g;

        $g = $x;
        $struct = $x->inputAny->any;
        if ($struct instanceof SOAPComplexType) {
                return array("return" => array("any" => new SoapVar($struct, 
SOAP_ENC_OBJECT, "SOAPComplexType", "http://soapinterop.org/xsd";, 
"SOAPComplexType", "http://soapinterop.org/";)));
        } else {
                return "?";
        }
}

class TestSoapClient extends SoapClient {
  function __construct($wsdl, $options) {
    parent::__construct($wsdl, $options);
    $this->server = new SoapServer($wsdl, $options);
    $this->server->addFunction('echoAnyElement');
  }

  function __doRequest($request, $location, $action, $version) {
    ob_start();
    $this->server->handle($request);
    $response = ob_get_contents();
    ob_end_clean();
    return $response;
  }
}

$client = new 
TestSoapClient(dirname(__FILE__)."/interop/Round4/GroupI/round4_groupI_xsd.wsdl",
                             array("trace"=>1,"exceptions"=>0,
                             'classmap' => 
array('SOAPComplexType'=>'SOAPComplexType')));
$ret = $client->echoAnyElement(
  array(
    "inputAny"=>array(
       "any"=>new SoapVar($struct, SOAP_ENC_OBJECT, "SOAPComplexType", 
"http://soapinterop.org/xsd";, "SOAPComplexType", "http://soapinterop.org/";)
     )));
var_dump($g);
var_dump($ret);
?>
--EXPECT--
object(stdClass)#5 (1) {
  ["inputAny"]=>
  object(stdClass)#6 (1) {
    ["any"]=>
    object(SOAPComplexType)#7 (3) {
      ["varInt"]=>
      int(34)
      ["varString"]=>
      string(3) "arg"
      ["varFloat"]=>
      float(325.325)
    }
  }
}
object(stdClass)#8 (1) {
  ["return"]=>
  object(stdClass)#9 (1) {
    ["any"]=>
    object(SOAPComplexType)#10 (3) {
      ["varInt"]=>
      int(34)
      ["varString"]=>
      string(3) "arg"
      ["varFloat"]=>
      float(325.325)
    }
  }
}

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

Reply via email to