dmitry Tue Sep 27 11:26:26 2005 EDT Added files: (Branch: PHP_5_0) /php-src/ext/soap/tests/bugs bug34643.phpt bug34643.wsdl
Modified files: /php-src NEWS /php-src/ext/soap soap.c Log: Fixed bug #34643 (wsdl default value has no effect) http://cvs.php.net/diff.php/php-src/NEWS?r1=1.1760.2.484&r2=1.1760.2.485&ty=u Index: php-src/NEWS diff -u php-src/NEWS:1.1760.2.484 php-src/NEWS:1.1760.2.485 --- php-src/NEWS:1.1760.2.484 Tue Sep 20 07:55:32 2005 +++ php-src/NEWS Tue Sep 27 11:26:24 2005 @@ -2,6 +2,7 @@ ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||| ?? ??? ????, PHP 5.0.6 - Renamed CachingRecursiveIterator to RecursiveCachingIterator. (Marcus) +- Fixed bug #34643 (wsdl default value has no effect). (Dmitry) - Fixed bug #34505 (Possible memory corruption when unmangling properties with empty names). (Tony) - Fixed bug #34478 (Incorrect parsing of url's fragment (#...)). (Dmitry) http://cvs.php.net/diff.php/php-src/ext/soap/soap.c?r1=1.110.2.43&r2=1.110.2.44&ty=u Index: php-src/ext/soap/soap.c diff -u php-src/ext/soap/soap.c:1.110.2.43 php-src/ext/soap/soap.c:1.110.2.44 --- php-src/ext/soap/soap.c:1.110.2.43 Mon Sep 12 04:26:05 2005 +++ php-src/ext/soap/soap.c Tue Sep 27 11:26:25 2005 @@ -17,7 +17,7 @@ | Dmitry Stogov <[EMAIL PROTECTED]> | +----------------------------------------------------------------------+ */ -/* $Id: soap.c,v 1.110.2.43 2005/09/12 08:26:05 dmitry Exp $ */ +/* $Id: soap.c,v 1.110.2.44 2005/09/27 15:26:25 dmitry Exp $ */ #ifdef HAVE_CONFIG_H #include "config.h" @@ -4004,9 +4004,21 @@ { xmlNodePtr xmlParam; encodePtr enc; + zval defval; if (param != NULL) { enc = param->encode; + if (val == NULL || Z_TYPE_P(val) == IS_NULL) { + if (param->element) { + if (param->element->fixed) { + ZVAL_STRING(&defval, param->element->fixed, 0); + val = &defval; + } else if (param->element->def && !param->element->nillable) { + ZVAL_STRING(&defval, param->element->def, 0); + val = &defval; + } + } + } } else { enc = NULL; } http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.phpt?r=1.1&p=1 Index: php-src/ext/soap/tests/bugs/bug34643.phpt +++ php-src/ext/soap/tests/bugs/bug34643.phpt --TEST-- Bug #34643 (wsdl default value) --SKIPIF-- <?php require_once('skipif.inc'); ?> --INI-- soap.wsdl_cache_enabled=0 --FILE-- <?php ini_set("soap.wsdl_cache_enabled", 0); class fp { public function get_it($opt="zzz") { return $opt; } } class LocalSoapClient extends SoapClient { function __construct($wsdl, $options) { parent::__construct($wsdl, $options); $this->server = new SoapServer($wsdl, $options); $this->server->setClass('fp'); } function __doRequest($request, $location, $action, $version) { ob_start(); $this->server->handle($request); $response = ob_get_contents(); ob_end_clean(); return $response; } } $cl = new LocalSoapClient(dirname(__FILE__).'/bug34643.wsdl', array("trace"=>1)); print_r($cl->__getFunctions()); echo $cl->get_it("aaa")."\n"; echo $cl->get_it()."\n"; ?> --EXPECT-- Array ( [0] => string get_it(string $opt) ) aaa zzz http://cvs.php.net/co.php/php-src/ext/soap/tests/bugs/bug34643.wsdl?r=1.1&p=1 Index: php-src/ext/soap/tests/bugs/bug34643.wsdl +++ php-src/ext/soap/tests/bugs/bug34643.wsdl <?xml version='1.0' encoding='UTF-8'?> <definitions name="wsdl" targetNamespace="urn:wsdl" xmlns:typens="urn:wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/" xmlns:soapenc="http://schemas.xmlsoap.org/soap/encoding/" xmlns:wsdl="http://schemas.xmlsoap.org/wsdl/" xmlns="http://schemas.xmlsoap.org/wsdl/"> <types> <xsd:schema xmlns="http://www.w3.org/2001/XMLSchema" targetNamespace="urn:wsdl"> <xsd:element name="opt" type="xsd:string" default="zzz" /> </xsd:schema> </types> <message name="get_it"> <part name="opt" element="typens:opt"/> </message> <message name="get_itResponse"> <part name="return" type="xsd:string"/> </message> <portType name="fpPortType"> <operation name="get_it"> <input message="typens:get_it"/> <output message="typens:get_itResponse"/> </operation> </portType> <binding name="fpBinding" type="typens:fpPortType"> <soap:binding style="rpc" transport="http://schemas.xmlsoap.org/soap/http"/> <operation name="get_it"> <soap:operation soapAction="urn:fpAction"/> <input> <soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </input> <output> <soap:body namespace="urn:wsdl" use="encoded" encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"/> </output> </operation> </binding> <service name="wsdlService"> <port name="fpPort" binding="typens:fpBinding"> <soap:address location="**********"/> </port> </service> </definitions> -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php