From 0554e14a3e9bcd0fc94ce7d11bcd519a347b4f94 Mon Sep 17 00:00:00 2001 From: Francis Besset Date: Wed, 12 Oct 2011 21:57:00 +0200 Subject: [PATCH] Renamed SoapServerBuilder::withHttpSession() to withPersistenceSession and added withPersistanceRequest() method --- src/BeSimple/SoapServer/SoapServerBuilder.php | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/src/BeSimple/SoapServer/SoapServerBuilder.php b/src/BeSimple/SoapServer/SoapServerBuilder.php index bf8b05e..e05d658 100644 --- a/src/BeSimple/SoapServer/SoapServerBuilder.php +++ b/src/BeSimple/SoapServer/SoapServerBuilder.php @@ -44,8 +44,6 @@ class SoapServerBuilder extends AbstractSoapBuilder { parent::__construct(); - $this->persistence = SOAP_PERSISTENCE_REQUEST; - // TODO: this is not the default, but safer $this->withErrorReporting(false); } @@ -57,7 +55,10 @@ class SoapServerBuilder extends AbstractSoapBuilder use_soap_error_handler($this->errorReporting); $server = new SoapServer($this->wsdl, $this->getSoapOptions()); - $server->setPersistence($this->persistence); + + if (null !== $this->persistence) { + $server->setPersistence($this->persistence); + } if (null !== $this->handlerClass) { $server->setClass($this->handlerClass); @@ -75,10 +76,17 @@ class SoapServerBuilder extends AbstractSoapBuilder return $this; } + public function withPersistanceRequest() + { + $this->persistence = SOAP_PERSISTENCE_REQUEST; + + return $this; + } + /** * Enables the HTTP session. The handler object is persisted between multiple requests in a session. */ - public function withHttpSession() + public function withPersistenceSession() { $this->persistence = SOAP_PERSISTENCE_SESSION;