|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2006-11-17 10:55 UTC] cem@php.net
[2006-11-17 11:30 UTC] mfp@php.net
[2006-11-17 12:08 UTC] cem@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 23:00:01 2025 UTC |
Description: ------------ I have an xsd that defines an element that can be empty. I can create an object to match OK but if I serialize it it will not de-serialize. I knwo the example looks a little odd but this is a simplified version of what we do when we construct WSDL for a method that takes no parameters - you get an empty element. If you can suggest a better way to code the element definition, one that will not cause this problem to occur, then that would be a satisfactory solution. Just coding <xs:element name="testTriggerEvent"/> is no better, by the way. Reproduce code: --------------- <?php echo phpversion('sdo') . "\n"; $wsdl = <<<EOF <?xml version="1.0" encoding="UTF-8"?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" targetNamespace="http://AnnotationTest"> <xs:element name="testTriggerEvent"> <xs:complexType> <xs:sequence> </xs:sequence> </xs:complexType> </xs:element> </xs:schema> EOF; file_put_contents('bug.wsdl',$wsdl); $xmldas = SDO_DAS_XML::create('bug.wsdl'); $doc = $xmldas->createDocument('testTriggerEvent'); $root = $doc->getRootDataObject(); $serialized_root = serialize ($root); $unserialized_root = unserialize($serialized_root); ?> Expected result: ---------------- I expect the object to de-serialize without any bother and definitely no exception to be thrown. Actual result: -------------- 1.0.4 <br /> <b>Fatal error</b>: Uncaught exception 'SDO_Exception' with message 'The referenced object is null ' in C:\Program Files\Apache Group\Apache2\htdocs\MyService\AnnotationTest\bug.php:23 Stack trace: #0 C:\Program Files\Apache Group\Apache2\htdocs\MyService\AnnotationTest\bug.php(23): unserialize('C:18:"SDO_DataO...') #1 C:\Program Files\Zend\ZendStudioClient-5.1.0\bin\php5\dummy.php(1): include('C:\Program File...') #2 {main} thrown in <b>C:\Program Files\Apache Group\Apache2\htdocs\MyService\AnnotationTest\bug.php</b> on line <b>23</b><br />