tags:

views:

32

answers:

1

I defined a SOAP Server in the following way.

ini_set('soap.wsdl_cache_enabled', 0);
ini_set('session.auto_start', 0); 
global $config_dir;     
session_start();

$server = new SoapServer("xxxx.wsdl");      
$server->setClass('import');
$server->setPersistence(SOAP_PERSISTENCE_SESSION);
$server->handle();

When I connect it with a SoapClient and calling the public functions, the session seems not persistent. I set a private variable on a first call but this variable looses its value on the second call....

$client = new SoapClient('xxxx.wsdl', array('trace' => 1, 'exceptions' => 1));

//The First call. I set the fromdb private variable to "nostran"
$client->setFromdb("nostran");  

//The second call. Here I need the fromdb but it has not any value....
$b = $client->setIrodak_id("1234");

Any thoughts? Thank you!

+1  A: 

_bogus_session_name seems to be the key in the session array that soap extension uses (see the source).

The usual advice on objects stored in the session apply: make sure the class definition is available before calling session_start or that you have an autoload handler set before calling handle.

Artefacto