Delicious Bookmark this on Delicious Share on Facebook SlashdotSlashdot It! Digg! Digg



PHP : Function Reference : SOAP Functions : SoapServer->setPersistence()

SoapServer->setPersistence()

Sets persistence mode of SoapServer ()

SoapServer {
  void setPersistence(int mode);
}

This function allows saving data between requests in a PHP session. It works only with a server that exports functions from a class with SoapServer->setClass().

Parameters

mode

One of the SOAP_PERSISTENCE_XXX constants.

Return Values

No value is returned.

Examples

Example 2287. Some examples

<?php

$server
->setPersistence(SOAP_PERSISTENCE_SESSION);

$server->setPersistence(SOAP_PERSISTENCE_REQUEST);

?>


Note:

The persistence SOAP_PERSISTENCE_SESSION makes persistent only object of given class, but not the class static data. You may use $this->bar instead of self::$bar.

Code Examples / Notes » soap_soapserver_setpersistence

jared

I had some issues getting session persistence (SOAP_PERSISTENCE_SESSION) to work. I finally got it working after setting session.auto_start=0, and then only calling session_start() in the script containing the SoapServer. Maybe this is obvious, but took me a bit to figure it out.
I only tried it with session.use_cookies=1, so if the settings above don't work for you, make sure cookies are enabled, though it may work without the need for cookies.


cperez1000

Always remember to place the "setPersistence" method before the handle method, otherwise it won't work.  It sounds obvious, but it's still a very common mistake, since no errors are shown.

Change Language


Follow Navioo On Twitter
is_soap_fault
SoapClient->__call()
SoapClient->__construct()
SoapClient->__doRequest()
SoapClient->__getFunctions()
SoapClient->__getLastRequest()
SoapClient->__getLastRequestHeaders()
SoapClient->__getLastResponse()
SoapClient->__getLastResponseHeaders()
SoapClient->__getTypes()
SoapClient->__setCookie()
SoapClient->__soapCall()
SoapFault->__construct()
SoapHeader->__construct()
SoapParam->__construct()
SoapServer->addFunction()
SoapServer->__construct()
SoapServer->fault()
SoapServer->getFunctions()
SoapServer->handle()
SoapServer->setClass()
SoapServer->setPersistence()
SoapVar->__construct()
use_soap_error_handler
eXTReMe Tracker