/** * @return SoapClient */ private function getCrowd() { global $caCrowdServerUrl, $caApplicationName, $caApplicationPassword; if (is_null($this->crowd)) { $this->crowd = new SoapClient($caCrowdServerUrl . '/SecurityServer?wsdl', array('classmap' => array('ApplicationAuthenticationContext' => 'caApplicationAuthenticationContext', 'PrincipalAuthenticationContext' => 'caPrincipalAuthenticationContext', 'PasswordCredential' => 'caPasswordCredential', 'AuthenticatedToken' => 'caAuthenticatedToken', 'SOAPPrincipal' => 'caPrincipal', 'SOAPAttribute' => 'caSOAPAttribute', 'SearchRestriction' => 'caSearchRestriction', 'SOAPGroup' => 'caSOAPGroup'))); $cred = new caPasswordCredential(); $cred->credential = $caApplicationPassword; $authctx = new caApplicationAuthenticationContext(); $authctx->credential = $cred; $authctx->name = $caApplicationName; $t = $this->crowd->authenticateApplication(array("in0" => $authctx)); $this->token = $t->out; } return $this->crowd; }