function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
spaceranger01spaceranger01 

How to make real time calls to salesforce APIs

Hi, 

 

   I am trying to implement real time web services to retrieve a column from Salesforce.  I am able to make successful calls. But If i cross 3600 logins with in an hour, it is throwing me invalid login exception. ("Application Login Rate Exceeded"). What is the best way to implement the realtime calls ? 

 

Thanks 

VinodMVinodM

Are you logging in everytime you make an API call? You should log in only once and keep the sessionid around and keep it in subsequent calls.

 

--Vinod.

spaceranger01spaceranger01

Thanks a lot for your reply. Where can I get the sample code in java to re use the session to make SF API calls  ? 

 

Thanks 

 

greentruck55greentruck55

I use the Partner WSDL to connect to SF from my client apps..

 

				ConnectorConfig config = new ConnectorConfig();
						  			config.setUsername((String)getServerParm("sfdc.username"));
		        if(Debug) System.out.println("the sf userid="+(String)getServerParm("sfdc.username"));

				config.setPassword((String)getServerParm("sfdc.password"));        
		      
			    connection = Connector.newConnection(config);  

			    sessionId = config.getSessionId();
				nextLoginTime = System.currentTimeMillis()+SessionTimeout;
				// get the timeout minutes and calculate to milliseconds.
				SessionTimeout = ((Integer)getServerParm("sfdc.sessiontime"))*(60*1000);

 then each time I start to call SF, I check my timeout time limit, and re-logon, then I reuse the connection to execute the SF api calls.

 

Sam