Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 0.14.0

Bug #19280 Nullstring SOAP_Value serialize to invalid XML
Submitted: 2012-02-07 18:20 UTC
From: live_gon Assigned:
Status: Open Package: SOAP (version 0.13.0)
PHP Version: 5.3.9 OS: Linux
Roadmaps: (Not assigned)    
Subscription  


 [2012-02-07 18:20 UTC] live_gon (Kazunari Hasegawa)
Description: ------------ Number type SOAP_Value serialize nullstring to invalid XML. Expected value is Nil. Test script: --------------- require_once('SOAP/Value.php'); $testtypes = array( 'releasedatetime' => 'dateTime', 'count' => 'int', 'onoff' => 'boolean', 'singlenumber' => 'float', 'doublenumber' => 'double', ); $soapbase = new SOAP_Base(); $values = array(); foreach($testtypes as $name=>$type){ $values[] = new SOAP_Value($name , $type); $values[] = new SOAP_Value($name , $type, ''); $values[] = new SOAP_Value($name , $type, 0); } foreach($values as $soapvalue){ echo $soapvalue->serialize($soapbase); } Expected result: ---------------- <releasedatetime xsi:type="xsd:dateTime" xsi:nil="true"/> <releasedatetime xsi:type="xsd:dateTime" xsi:nil="true"/> <releasedatetime xsi:type="xsd:dateTime" xsi:nil="true"/> <count xsi:type="xsd:int" xsi:nil="true"/> <count xsi:type="xsd:int" xsi:nil="true"/> <count xsi:type="xsd:int">0</count> <onoff xsi:type="xsd:boolean">false</onoff> <onoff xsi:type="xsd:boolean">false</onoff> <onoff xsi:type="xsd:boolean">false</onoff> <singlenumber xsi:type="xsd:float" xsi:nil="true"/> <singlenumber xsi:type="xsd:float" xsi:nil="true"/> <singlenumber xsi:type="xsd:float">0</singlenumber> <doublenumber xsi:type="xsd:double" xsi:nil="true"/> <doublenumber xsi:type="xsd:double" xsi:nil="true"/> <doublenumber xsi:type="xsd:double">0</doublenumber> Actual result: -------------- <releasedatetime xsi:type="xsd:dateTime" xsi:nil="true"/> <releasedatetime xsi:type="xsd:dateTime"></releasedatetime> <releasedatetime xsi:type="xsd:dateTime">0</releasedatetime> <count xsi:type="xsd:int" xsi:nil="true"/> <count xsi:type="xsd:int"></count> <count xsi:type="xsd:int">0</count> <onoff xsi:type="xsd:boolean">false</onoff> <onoff xsi:type="xsd:boolean">false</onoff> <onoff xsi:type="xsd:boolean">false</onoff> <singlenumber xsi:type="xsd:float" xsi:nil="true"/> <singlenumber xsi:type="xsd:float"></singlenumber> <singlenumber xsi:type="xsd:float">0</singlenumber> <doublenumber xsi:type="xsd:double" xsi:nil="true"/> <doublenumber xsi:type="xsd:double"></doublenumber> <doublenumber xsi:type="xsd:double">0</doublenumber>

Comments