public SalesforceDataContext(String username, String password, String securityToken) { super(false); try { _connection = Connector.newConnection(username, securityToken == null ? password : password + securityToken); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
public SalesforceDataContext(String username, String password, String securityToken) { try { _connection = Connector.newConnection(username, password + securityToken); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
public SalesforceDataContext(String username, String password, String securityToken) { super(false); try { _connection = Connector.newConnection(username, securityToken == null ? password : password + securityToken); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
public SalesforceDataContext(String username, String password) { super(false); try { _connection = Connector.newConnection(username, password); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
public SalesforceDataContext(String username, String password) { super(false); try { _connection = Connector.newConnection(username, password); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
public static PartnerConnection newConnection(String username, String password) throws ConnectionException { ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(password); return newConnection(config); }
public SalesforceDataContext(String endpoint, String username, String password, String securityToken) { super(false); try { final ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(securityToken == null ? password : password + securityToken); if (endpoint != null) { config.setAuthEndpoint(endpoint); config.setServiceEndpoint(endpoint); } _connection = Connector.newConnection(config); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
private PartnerConnection createConnection() { if (connection == null) { PartnerConnectionConnectorConfig pcConnectorConfig = new PartnerConnectionConnectorConfig(); ConnectorConfig config = pcConnectorConfig.createConfig(); LOG.debug("creating connection for : " + CommandLineArguments.getUsername() + " " + CommandLineArguments.getOrgUrl() + " " + config.getUsername() + " " + config.getAuthEndpoint()); try { connection = Connector.newConnection(config); setSessionIdFromConnectorConfig(config); LOG.debug("Partner Connection established with the org!! \n SESSION ID IN createPartnerConn: " + sessionIdFromConnectorConfig); } catch (ConnectionException connEx) { ApexUnitUtils.shutDownWithDebugLog(connEx, ConnectionHandler .logConnectionException(connEx, connection)); } } return connection; }
/** * {@inheritDoc} */ protected SfdcChatterTransport(String usr, String psw) { this.setUsername(usr); this.setPassword(psw); ConnectorConfig config = new ConnectorConfig(); config.setUsername(getUsername()); config.setPassword(getPassword()); try { connection = Connector.newConnection(config); } catch (ConnectionException e) { l.debug("Error connecting to SFDC.", e); throw new SfdcException("Error connecting to SFDC.", e); } }
public SalesforceDataContext(String endpoint, String username, String password, String securityToken) { super(false); try { final ConnectorConfig config = new ConnectorConfig(); config.setUsername(username); config.setPassword(securityToken == null ? password : password + securityToken); if (endpoint != null) { config.setAuthEndpoint(endpoint); config.setServiceEndpoint(endpoint); } _connection = Connector.newConnection(config); } catch (ConnectionException e) { throw SalesforceUtils.wrapException(e, "Failed to log in to Salesforce service"); } }
config.setSessionId(securityContext.getSessionId()); GetUserInfoResult userInfoResult = Connector.newConnection(config).getUserInfo(); results = Connector.newConnection(config).retrieve("Name", "Profile", new String[] {userInfoResult.getProfileId()}); } catch (ConnectionException e) {
config.setSessionId(securityContext.getSessionId()); GetUserInfoResult userInfoResult = Connector.newConnection(config).getUserInfo(); results = Connector.newConnection(config).retrieve("Name", "Profile", new String[] {userInfoResult.getProfileId()}); } catch (ConnectionException e) {
public static PartnerConnection getPartnerConnection(SalesforceConfig config) throws ConnectionException { ConnectorConfig cc = new ConnectorConfig(); cc.setUsername(config.getUsername()); cc.setPassword(config.getPassword()); cc.setManualLogin(false); String authEndpoint = String.format(ENDPOINT_SOAP, config.getServerUrl(), config.getApiVersion()); cc.setAuthEndpoint(authEndpoint); PartnerConnection partnerConnection = com.sforce.soap.partner.Connector.newConnection(cc); partnerConnection.login(config.getUsername(), config.getPassword()); return partnerConnection; }
private void initConnection() throws ConnectionException { if (config == null) { config = getConfig(); initConfig(); } config.setRequestHeader("User-Agent", API_USER_AGENT); this.connection = Connector.newConnection(config); CallOptions_element co = new CallOptions_element(); // Give the connection a client id if we have one if (this.clientId != null) { co.setClient(this.clientId); } else if (this.externalClientId != null) { // Check for any external client id we might // have come across (see getConfig) co.setClient(this.externalClientId); } else { co.setClient(API_USER_AGENT); //just default it to the version of the sdk } this.connection.__setCallOptions(co); }
private void initConnection() throws ConnectionException { if (config == null) { config = getConfig(); initConfig(); } config.setRequestHeader("User-Agent", API_USER_AGENT); this.connection = Connector.newConnection(config); CallOptions_element co = new CallOptions_element(); // Give the connection a client id if we have one if (this.clientId != null) { co.setClient(this.clientId); } else if (this.externalClientId != null) { // Check for any external client id we might // have come across (see getConfig) co.setClient(this.externalClientId); } else { co.setClient(API_USER_AGENT); //just default it to the version of the sdk } this.connection.__setCallOptions(co); }