Re[2]: [PHP] Serializing a DOM object
| From: | Tom Rogers | Date: | Tue, 31 Dec 2002 03:30:40 +0000 |
| Subject: | Re[2]: [PHP] Serializing a DOM object | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-129726@lists.php.net to get a copy of this message | ||
Hi,
Tuesday, December 31, 2002, 2:55:39 AM, you wrote:
>> In the test function, if I just serialize the $xml, return it and then call
>> xmldoc_open_mem on the unserialized return string, it works fine.
>> But it doesn't like it if I do the above. I'm getting the error:
>>
>> Warning: dump_mem() [function.dump-mem]: Underlying object missing
>> or of invalid type
>> Warning: dump_mem() [function.dump-mem]: Cannot fetch DOM object
>>
>> Why isn't the serialization of the DOM object not working that way?
CB> I just had a thought... Is it because the DOM structure of the XML document
CB> is stored only in the memory for the page? And the pointer to that memory
CB> isn't transferred when the DOM object is serialized, stored and retrieved?
CB> Chris
Try encoding like this:
$retval = base64_encode(serialize( domxml_open_mem( $xml )));
and on the next page:
$xml = unserialize(base64_decode($xml));
It works via html but don't know enough about soap
--
regards,
Tom