SoapServer->setPersistence()

(no version information, might be only in CVS)

SoapServer->setPersistence() --  Sets persistence mode of SoapServer

说明

class 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().

参数

mode

One of the SOAP_PERSISTENCE_XXX constants.

返回值

无返回值。

范例

例子 1. Some examples

<?php

$server
->setPersistence(SOAP_PERSISTENCE_SESSION);

$server->setPersistence(SOAP_PERSISTENCE_REQUEST);

?>


add a note add a note User Contributed Notes
jared at ws-db dot com
29-Aug-2005 03:07
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 at hotmail dot com
29-May-2005 11:54
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.