Thursday, July 24, 2008
Home | Benchmarks | Documentation | Samples | FAQ | Links | Download
search php-soap for  


Samples

5. Session Object

 

Description:

 
  This example shows how you PHP-SOAP uses PHP's session handling to create persistant SoapObjects.

 
 

Client:  session_object-client.php

 
 

<?
$obj
= new SoapObject('http://www.yourserver.com/session_object.php', 'urn:SessionObject');
$obj->setData("persistent objects do work");
echo
$obj->getData();
?>
1


 
 

Server:  session_object-server.php

 
 

<?
$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


 
blue | green | yellow | grey
SourceForge Logo
Go to the main PHP site