Serializing a DOM object
| From: | Boget, Chris | Date: | Mon, 30 Dec 2002 10:11:16 +0000 |
| Subject: | Serializing a DOM object | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-129638@lists.php.net to get a copy of this message | ||
Consider the following:
page1.php
<?php
// initializing soap server object, blah, blah, whatever here.
// the important function, dumbed down to the barest essentials.
//
function test() {
$retval = "";
$xml =
"<root><row><element>test</element></row></root>\n";
$retval = serialize( domxml_open_mem( $xml ));
return $retval;
}
?>
page2.php
<?php
require_once( 'nusoap.php' );
// this is immaterial; don't dwell on it ;p I'm just dumbing it down.
$parameters = array();
$soapclient = new soapclient( 'http://somepage.php' );
$xml = $soapclient->call( 'test', $parameters );
$xml = unserialize( $xml );
$xml->dump_mem();
?>
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?
thnx,
Chris