#34643 [NEW]: wsdl default value

From: Date: Mon, 26 Sep 2005 11:28:22 +0000
Subject: #34643 [NEW]: wsdl default value
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-85590@lists.php.net to get a copy of this message
From: camka at email dot ee Operating system: linux PHP version: 5.0.5 PHP Bug Type: SOAP related Bug description: wsdl default value Description: ------------ I want to set default value for the parameter passed to the remote function in wsdl file. When working in non-wsdl mode, the default value on server side is initiated with no problems. But when using wsdl file for client/server initialization, the default value is processed strange way. Reproduce code: --------------- ======= srv.php ========== class fp { public function get_it($opt = 'zzz') { return $opt; } } $srv = new SoapServer('wsdl.wsdl'); $srv->setClass('fp'); $srv->handle(); ======= client.php ========== ... $cl = new SoapClient('wsdl.wsdl', $options); var_dump($cl->__getFunctions()); echo $cl->get_it(); ======== wsdl.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" default="zzz" /> </xsd:schema> </types> <message name="get_it"> <part name="opt" type="typens:opt"/> </message> <message name="get_itResponse"> <part name="return" type="xsd:string"/> </message> <portType name="fpPortType"> <operation name="get_it"> <documentation> Enter description here... </documentation> <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> ======== SOAP request ============== <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:get_it> <opt xsi:nil="1"/> </ns1:get_it> </SOAP-ENV:Body> </SOAP-ENV:Envelope> =========== SOAP Response ========= <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ns1="urn:wsdl" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" SOAP-ENV:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"> <SOAP-ENV:Body> <ns1:get_itResponse> <return xsi:nil="1"/> </ns1:get_itResponse> </SOAP-ENV:Body> </SOAP-ENV:Envelope> Expected result: ---------------- array(1) { [0]=> string(27) "string get_it(opt $opt)" } zzz Actual result: -------------- array(1) { [0]=> string(27) "string get_it(UNKNOWN $opt)" } NULL -- Edit bug report at http://bugs.php.net/?id=34643&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34643&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34643&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34643&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34643&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34643&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34643&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34643&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34643&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34643&r=support Expected behavior: http://bugs.php.net/fix.php?id=34643&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34643&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34643&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34643&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34643&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34643&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34643&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34643&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34643&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34643&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34643&r=mysqlcfg

« previous php.bugs (#85590) next »