+ " : " + this.loginResult.getSessionId() ); log.logDebug( BaseMessages.getString( PKG, "SalesforceInput.Log.NewServerURL" ) + " : " + this.loginResult.getServerUrl() ); pConnection.setSessionHeader( loginResult.getSessionId() ); config.setServiceEndpoint( loginResult.getServerUrl() );
@Override public com.sforce.soap.partner.ILoginResult newILoginResult() { return new com.sforce.soap.partner.LoginResult(); }
private void loadFields1(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { setMetadataServerUrl(__in, __typeMapper); setPasswordExpired(__in, __typeMapper); setSandbox(__in, __typeMapper); setServerUrl(__in, __typeMapper); setSessionId(__in, __typeMapper); setUserId(__in, __typeMapper); setUserInfo(__in, __typeMapper); }
boolean _equals; _equals = true && ((this.metadataServerUrl == null && other.getMetadataServerUrl() == null) || (this.metadataServerUrl != null && this.metadataServerUrl.equals(other.getMetadataServerUrl()))) && this.passwordExpired == other.isPasswordExpired() && this.sandbox == other.isSandbox() && ((this.serverUrl == null && other.getServerUrl() == null) || (this.serverUrl != null && this.serverUrl.equals(other.getServerUrl()))) && ((this.sessionId == null && other.getSessionId() == null) || (this.sessionId != null && this.sessionId.equals(other.getSessionId()))) && ((this.userId == null && other.getUserId() == null) || (this.userId != null && this.userId.equals(other.getUserId()))) && ((this.userInfo == null && other.getUserInfo() == null) || (this.userInfo != null && this.userInfo.equals(other.getUserInfo()))); __equalsCalc = null; return _equals;
/** * Provides manual login as in {@link PartnerConnection} constructor, checks login result for valid connection/credentials. * * @param config connector configuration with endpoint/userId/password * @param connection to be used for login in Salesforce. * @throws ConnectionException if password has been expired or bad connection to Salesforce. * @see com.sforce.soap.partner.PartnerConnection#PartnerConnection(ConnectorConfig config) */ private void performLogin(ConnectorConfig config, PartnerConnection connection) throws ConnectionException { config.setServiceEndpoint(config.getAuthEndpoint()); LoginResult loginResult = connection.login(config.getUsername(), config.getPassword()); if (loginResult.isPasswordExpired()) { throw new ConnectionException(MESSAGES.getMessage("error.expiredPassword")); } config.setSessionId(loginResult.getSessionId()); config.setServiceEndpoint(loginResult.getServerUrl()); connection.setSessionHeader(loginResult.getSessionId()); }
public static MetadataConnection getMetadataConnection(PartnerConnection pc, SalesforceConfig config) throws ConnectionException { LoginResult lr = pc.login(config.getUsername(), config.getPassword()); ConnectorConfig cc = new ConnectorConfig(); cc.setUsername(config.getUsername()); cc.setPassword(config.getPassword()); cc.setSessionId(lr.getSessionId()); cc.setServiceEndpoint(lr.getMetadataServerUrl()); cc.setManualLogin(false); MetadataConnection connection = com.sforce.soap.metadata.Connector.newConnection(cc); return connection; }
loginResult = new com.sforce.soap.partner.LoginResult(); loginResult.setSessionId(accessToken.substring(7)); // remove "Bearer " prefix. partnerURL = partnerURL.replace("{version}", apiVersion); loginResult.setServerUrl(partnerURL);
public static SoapConnection getToolingConnection(PartnerConnection pc, SalesforceConfig config) throws ConnectionException { LoginResult lr = pc.login(config.getUsername(), config.getPassword()); ConnectorConfig toolingConfig = new ConnectorConfig(); toolingConfig.setSessionId(pc.getSessionHeader().getSessionId()); toolingConfig.setServiceEndpoint(lr.getServerUrl().replace("Soap/u/", "Soap/s/")); toolingConfig.setManualLogin(false); SoapConnection soapConnection = Connector.newConnection(toolingConfig); return soapConnection; }
protected void setSessionId(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { __in.peekTag(); if (__typeMapper.verifyElement(__in, _lookupTypeInfo("sessionId", "urn:partner.soap.sforce.com","sessionId","http://www.w3.org/2001/XMLSchema","string",1,1,true))) { setSessionId(__typeMapper.readString(__in, _lookupTypeInfo("sessionId", "urn:partner.soap.sforce.com","sessionId","http://www.w3.org/2001/XMLSchema","string",1,1,true), java.lang.String.class)); } }
protected void setServerUrl(com.sforce.ws.parser.XmlInputStream __in, com.sforce.ws.bind.TypeMapper __typeMapper) throws java.io.IOException, com.sforce.ws.ConnectionException { __in.peekTag(); if (__typeMapper.verifyElement(__in, _lookupTypeInfo("serverUrl", "urn:partner.soap.sforce.com","serverUrl","http://www.w3.org/2001/XMLSchema","string",1,1,true))) { setServerUrl(__typeMapper.readString(__in, _lookupTypeInfo("serverUrl", "urn:partner.soap.sforce.com","serverUrl","http://www.w3.org/2001/XMLSchema","string",1,1,true), java.lang.String.class)); } }
public synchronized int hashCode() { if (__hashCodeCalc) { return 0; } __hashCodeCalc = true; int _hashCode = 1; if (getMetadataServerUrl() != null) { _hashCode += getMetadataServerUrl().hashCode(); } _hashCode += (isPasswordExpired() ? Boolean.TRUE : Boolean.FALSE).hashCode(); _hashCode += (isSandbox() ? Boolean.TRUE : Boolean.FALSE).hashCode(); if (getServerUrl() != null) { _hashCode += getServerUrl().hashCode(); } if (getSessionId() != null) { _hashCode += getSessionId().hashCode(); } if (getUserId() != null) { _hashCode += getUserId().hashCode(); } if (getUserInfo() != null) { _hashCode += getUserInfo().hashCode(); } __hashCodeCalc = false; return _hashCode; }
/** * Provides manual login as in {@link PartnerConnection} constructor, checks login result for valid connection/credentials. * * @param config connector configuration with endpoint/userId/password * @param connection to be used for login in Salesforce. * @throws ConnectionException if password has been expired or bad connection to Salesforce. * @see com.sforce.soap.partner.PartnerConnection#PartnerConnection(ConnectorConfig config) */ private void performLogin(ConnectorConfig config, PartnerConnection connection) throws ConnectionException { config.setServiceEndpoint(config.getAuthEndpoint()); LoginResult loginResult = connection.login(config.getUsername(), config.getPassword()); if (loginResult.isPasswordExpired()) { throw new ConnectionException(MESSAGES.getMessage("error.expiredPassword")); } config.setSessionId(loginResult.getSessionId()); config.setServiceEndpoint(loginResult.getServerUrl()); connection.setSessionHeader(loginResult.getSessionId()); }
if (loginResult.isPasswordExpired()) { l.debug("An error has occurred. Your password has expired."); throw new SfdcException("An error has occurred. Your password has expired."); loginResult.getServerUrl()); sh.setSessionId(loginResult.getSessionId());
public PartnerConnection(ConnectorConfig config) throws ConnectionException { this.__config = config; this.__typeMapper.setPackagePrefix(null); this.__typeMapper.setConfig(config); config.verifyPartnerEndpoint(); if (!config.isManualLogin()) { if (config.getSessionId()==null) { config.setServiceEndpoint(config.getAuthEndpoint()); com.sforce.soap.partner.LoginResult result = login(config.getUsername(), config.getPassword()); config.setSessionId(result.getSessionId()); config.setServiceEndpoint(result.getServerUrl()); } else { if (config.getServiceEndpoint() == null) { throw new com.sforce.ws.ConnectionException("Please set ServiceEndpoint"); } } } __SessionHeader = new SessionHeader_element(); __SessionHeader.setSessionId(config.getSessionId()); }