 |
Samples
5. Session Object
|
 |
| |
Description:
|
|
| |
This example shows how you PHP-SOAP uses PHP's session handling to create persistant SoapObjects.
|
|
| |
|
|
| |
<? $obj = new SoapObject('http://www.yourserver.com/session_object.php', 'urn:SessionObject'); $obj->setData("persistent objects do work"); echo $obj->getData(); ?>
1
|
|
| |
|
|
| |
<? $server = new SoapServer("urn:SessionObject"); $server->setClass('SessionObject'); $server->setPersistence(SOAP_PERSISTENCE_SESSION); $server->handle();
class SessionObject { var $data;
function getData() { return $this->data; } function setData($data) { $this->data = $data; } } ?>
1
|
|