RE: [PHP-SOAP-DEV] bug storing the SoapObject in session
Status: Alpha
Brought to you by:
rodif_bl
From: phpsurf <ph...@if...> - 2002-05-13 20:48:19
|
> -----Original Message----- > From: php...@li... > [mailto:php...@li...]On Behalf > Of brad lafountain > Sent: lundi 13 mai 2002 19:22 > To: andrey > Cc: php...@li... > Subject: Re: [PHP-SOAP-DEV] bug storing the SoapObject in session > > > Yeah this basically is the problem... > > > But the bigger problem is that __wakeup and __sleep don't get passed to > overloaded 'c' objects (which is what SoapObject is). I posted a > patch a while > ago along with the ability to serailzie java objects. It never > got patched. > > > But besides that the example up on the website was ment to show you the > perstance server objects not a perstant client objects. > That's right, I knew that ! just wanted to get the most of the extension :) don't you have an idea on how to do that ? indead the main problem is to find a way to rebuild (in the second client load) the uri to the server re-using the same cookies variables ... so the session will be propagated on the soap-server side through the session on the soap-client side ... hope youl'll find something ! > > Hope this helps > > - Brad > > --- andrey <ahr...@ic...> wrote: > > I think I know what is the problem. > > When object is serialiazed all it's properties are serialized but some > > properties have no meaning after serialization. For example a > class wrapper > > for DB connection may have property $link (resource of type > mysql) but this > > link has meaning only on the page where it is created. If we > serialize $link > > there will be problem when deserialized. I don't know what is > the solution > > for module but in userspace this is solvable with 2 methods > > __sleep(), __wakeup(). In case you don't know about them I'll > explain. When > > PHP wants to serialize an object it tries to execute __sleep() if mehtod > > > with such name executes. PHP wants to receive an array with > > names (strings) > > > of properties that have to be serialized. Probably if there is > > no __sleep() > > > all properties are serialized. On the other hand when PHP > > deserializes an > > > object it tries to call __wakeup(). __wakeup() is used in case some > > > initializations are needed on object recreation - in our case > (PHP-SOAP) > > > httpurl is of type resource and has to be created in __wakeup() > > and not to > > > be serialized - so __sleep() has to return an array with names > > where there > > > is no element "httpurl". > > > > > > Regards, > > > Andrey > > > > > > ----- Original Message ----- > > > From: "phpsurf" <ph...@if...> > > > To: "brad lafountain" <rod...@ya...>; > > > <php...@li...> > > > Sent: Friday, May 10, 2002 1:12 PM > > > Subject: [PHP-SOAP-DEV] bug storing the SoapObject in session > > > > > > > > > > Hi > > > > > > > > I tried something with your 4th example : session > > > > > > > > your example shows haow to maintain a session on the server > > side through > > > > serveral consecutive calls to method of the SoapObject on the > > client side, > > > > but inside the same script. > > > > > > > > my idea was to maintain this soap-server session through > > several calls to > > > > the soap-client script. > > > > > > > > so I simply tried to put the SoapObject (client side) in session. > > > > > > > > here is my new session-client-src.php script: > > > > > > > > ---------------------------------------------------- > > > > <? > > > > session_start(); > > > > session_register("session"); > > > > > > > > if(!isset($session)) { > > > > echo "create Soap Client\n"; > > > > $session = new > > > > > > > > > SoapObject("http://lab.localhost.com/soap/PhpSoapToolkit/samples/s > > ession-ser > > > > ver-src.php", "urn:Session"); > > > > } > > > > > > > > echo "counter:\n"; > > > > > > > > echo $session->inc() . "\n"; > > > > echo $session->inc() . "\n"; > > > > ?> > > > > ---------------------------------------------------- > > > > > > > > The 1st time I call this script, I get the following result : > > > > > > > > ---------------------------------------------------- > > > > create Soap Client > > > > counter: > > > > 0 > > > > 1 > > > > ---------------------------------------------------- > > > > > > > > > > > > But the 2nd time I call this script, I get the following > > result which is > > > > fine (the counter is well incremented), except for the warning :) > > > > > > > > ---------------------------------------------------- > > > > counter: > > > > <br /> > > > > <b>Warning</b>: (null)(): supplied argument is not a valid httpurl > > > resource > > > > in > > > > <b>c:\webroot\lab\soap\phpsoaptoolkit\samples\session-client-src.php</b> > > > > on line <b>12</b><br /> > > > > 2 > > > > 3 > > > > ---------------------------------------------------- > > > > > > > > hope you will find out the bug ! > > > > > > > > > > > > > > > > > > > > > __________________________________________________________________ > > __________ > > > __ > > > > ifrance.com, l'email gratuit le plus complet de l'Internet ! > > > > vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... > > > > http://www.ifrance.com/_reloc/email.emailif > > > > > > > > > > > > > > > > _______________________________________________________________ > > > > > > > > Have big pipes? SourceForge.net is looking for download > > mirrors. We supply > > > > the hardware. You get the recognition. Email Us: > > ban...@so... > > > > _______________________________________________ > > > > Phpsoaptoolkit-development mailing list > > > > Php...@li... > > > > > > https://lists.sourceforge.net/lists/listinfo/phpsoaptoolkit-development > > > > > > > > > > > > > __________________________________________________ > > Do You Yahoo!? > > LAUNCH - Your Yahoo! Music Experience > > http://launch.yahoo.com > > > > _______________________________________________________________ > > > > Have big pipes? SourceForge.net is looking for download > mirrors. We supply > > the hardware. You get the recognition. Email Us: > ban...@so... > > _______________________________________________ > > Phpsoaptoolkit-development mailing list > > Php...@li... > > https://lists.sourceforge.net/lists/listinfo/phpsoaptoolkit-development ______________________________________________________________________________ ifrance.com, l'email gratuit le plus complet de l'Internet ! vos emails depuis un navigateur, en POP3, sur Minitel, sur le WAP... http://www.ifrance.com/_reloc/email.emailif |