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
AlexandruAlexandru 

Can't connect to login server using Java code - Timeout

Hi,

 

I am having serious issues connecting from Java code to the login server.

I use the following:

- Partner_20.0.wsdl

- I created the associated Jar file for the partner.wsdl

- Added to Buildpath in Eclipse: partner.wsdl jar and the wsc-22.jar

 

The problem I have is that I receive timeouts no matter how much I set the time out in the code.

We use here as login server this one: https://test.salesforce.com/services/Soap/u/20.0

The above connection URL works since it was tested from our Tibco processes

 

Here is my code:

 

// first login to get the session id and serverUrl to be able to call the web service API
               ConnectorConfig config = new ConnectorConfig();
               config.setManualLogin(true);
               config.setAuthEndpoint(authEndpoint);           
               config.setConnectionTimeout(connectionTimeout);
               config.setReadTimeout(120);
               config.setCompression(compress);
               config.setUsername(username);
               config.setPassword(password);
               
               authenticationConnection = Connector.newConnection(config);
               LoginResult loginResult = authenticationConnection.login(username, password);
               
               System.out.println("Successfully Logged in into the SalesForce Authentication server");
            
            
            // The connection details are received from the SalesForce authentication server.
            // Once authenticated on first login:
            // - Create a new Config object
            // - Assign to the new Config object: session id and serverUrl
            // - Create a new connection with this info
               ConnectorConfig partnerConfig = new ConnectorConfig();
               partnerConfig.setSessionId(loginResult.getSessionId());
               partnerConfig.setServiceEndpoint(loginResult.getServerUrl());
               wsConnection = Connector.newConnection(partnerConfig);
            
               System.out.println("Successfully Logged in into the SalesForce API server");

 

 

Thanks,

Alexandru