/** * Destroys session with API * @return bool */ public function logout() { if ($this->getSessionStatus()) { $this->_setStreamContextSession(null); $headers = array(new \SoapHeader('http://www.w3.org/2005/08/addressing', 'Action', $this->_getMethodUrl('Wyloguj'), 0), new \SoapHeader('http://www.w3.org/2005/08/addressing', 'To', $this->_getServiceUrl(), 0)); $this->__setSoapHeaders($headers); $result = parent::Wyloguj(array('pIdentyfikatorSesji' => $this->_sessionId))->WylogujResult; if ($result) { $this->storeSession(null); $this->_setStreamContextSession(null); } return $result ? true : false; } return true; }