note 82053 added to function.soap-soapserver-setpersistence
| From: | boogiebug at gmail dot com | Date: | Wed, 26 Mar 2008 03:40:41 +0000 |
| Subject: | note 82053 added to function.soap-soapserver-setpersistence | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-137585@lists.php.net to get a copy of this message | ||
setPersistence works only for a single instance of service class.
To use multiple instance of services objects, you need to instantiate the classes into objects and
use an undocumented SoapServer's method - setObject() to add the service object into the
SoapServer object, and handle the service object persistence with $_SESSION instead.
For example:
$ServiceObjects = array()
$ServiceObjects[0] = new ServiceClass1();
$ServiceObjects[1] = new ServiceClass2();
$ServiceObjects[2] = new ServiceClass3();
$_SESSION['ServiceClass1'] = $ServiceObjects[0];
$_SESSION['ServiceClass2'] = $ServiceObjects[1];
$_SESSION['ServiceClass3'] = $ServiceObjects[2];
...
$Servers = array()
for ( $i = 0; $i < count($ServiceObjects); i++)
{
$s = new SoapServer($wsdl);
$s->setObject($ServiceObject[$i]);
$Servers[] = $s;
}
...
$Server[$i]->handle()
...
----
Server IP: 203.121.145.99
Probable Submitter: 124.120.183.163
----
Manual Page -- http://www.php.net/manual/en/function.soap-soapserver-setpersistence.php
Edit -- https://master.php.net/note/edit/82053
Del: integrated -- https://master.php.net/note/delete/82053/integrated
Del: useless -- https://master.php.net/note/delete/82053/useless
Del: bad code -- https://master.php.net/note/delete/82053/bad+code
Del: spam -- https://master.php.net/note/delete/82053/spam
Del: non-english -- https://master.php.net/note/delete/82053/non-english
Del: in docs -- https://master.php.net/note/delete/82053/in+docs
Del: other reasons-- https://master.php.net/note/delete/82053
Reject -- https://master.php.net/note/reject/82053
Search -- https://master.php.net/manage/user-notes.php