protected function getSoapLoginResult() { //@todo use client provided Salesforce wsdl for the different versions $wsdl = __DIR__ . '/../../config/enterprise.wsdl.xml'; $builder = new SoapClient\ClientBuilder($wsdl, $this->username, $this->password, $this->securityToken); $soapClient = $builder->build(); if (!isset($soapClient)) { throw new InternalServerErrorException('Failed to build session with Salesforce.'); } $result = $soapClient->getLoginResult(); $this->sessionCache['server_instance'] = $result->getServerInstance(); $this->sessionCache['session_id'] = $result->getSessionId(); // Pii::setState( 'service.' . $this->getApiName() . '.cache', $this->sessionCache ); }
/** * SalesforceManager constructor. * * @param ClientBuilder $soapFactory * @param Memcache $memcached * @param integer $memcached_ttl */ public function __construct(ClientBuilder $soapFactory, Memcache $memcached, $memcached_ttl) { $this->soapClient = $soapFactory->build(); $this->memcached = $memcached; $this->memcached_ttl = $memcached_ttl; }