/** * Creates the session header if a valid login result * is present. * * @return \SoapHeader|null */ protected function getSessionHeader() { if (null === $this->getLoginResult()) { $this->sessionHeader = null; } elseif (null === $this->sessionHeader) { // ASSUME SESSION HEADER IS NEW; SO LOGIN RESULT IS FRESH ALSO $this->setEndpointLocation($this->loginResult->getServerUrl()); $this->sessionHeader = new \SoapHeader($this->getConnection()->getWsdl()->getTns(), 'SessionHeader', array('sessionId' => $this->loginResult->getSessionId())); } return $this->sessionHeader; }
protected function setLoginResult(Result\LoginResult $loginResult) { $this->loginResult = $loginResult; $this->setEndpointLocation($loginResult->getServerUrl()); $this->setSessionId($loginResult->getSessionId()); }