The request failed. The remote server returned an error: (440) Login Timeout

Naeem 0 Reputation points
2024-03-31T09:29:52.4266667+00:00

I've integrated the ExchangeService, but encountered an error when attempting to run it. The error message indicates: "The request failed. The remote server returned an error: (440) Login Timeout."

Below is the code I'm using for your reference. Provide the dummy cred. I've tried both the autodiscovery URL and providing the exact URL, but the result remains the same. Additionally, I've tried using different dependencies, but the outcome persists.

<dependency>
      <groupId>com.microsoft.ews-java-api</groupId>
      <artifactId>ews-java-api</artifactId>
      <version>2.0</version>
</dependency>
<dependency>
      <groupId>com.surevine</groupId>
      <artifactId>ews-java-api</artifactId>
      <version>2.9</version>
</dependency>
import java.net.URI;
import java.text.ParseException;

import microsoft.exchange.webservices.data.core.ExchangeService;
import microsoft.exchange.webservices.data.core.enumeration.property.WellKnownFolderName;
import microsoft.exchange.webservices.data.core.service.folder.Folder;
import microsoft.exchange.webservices.data.credential.ExchangeCredentials;
import microsoft.exchange.webservices.data.credential.WebCredentials;

public class EWSService {
	public static void main(String args[]) throws ParseException
	{
	try {
		//String exchangeUrl = "https://example.com/Exchange.asmx";
		String exchangeUrl = "https://autodiscover.example.com/owa";
			
		String username ="groupid\\Example";                      
	        String password = "test"; 
	        String emailId="example@outlook.com";
	        
	        ExchangeService service = new ExchangeService();
	        ExchangeCredentials credentials = new WebCredentials(username, password);
	        service.setCredentials(credentials);
	        service.setUrl(new URI(exchangeUrl));
	        
	        
	       //service.autodiscoverUrl(emailId, new RedirectionUrlCallback());
	        
	     // Bind to the Inbox.
	        Folder inbox = Folder.bind(service, WellKnownFolderName.Inbox);
		}
		catch(Exception e) {
			e.printStackTrace();
		}
	}
}

I also attempted to verify the connection by running the ping command in CMD with my Exchange URL, and I received successful responses. Furthermore, I tried logging in via a browser and successfully accessed the system. Despite these efforts, the issue persists.

I would greatly appreciate any assistance that anyone can offer.

Exchange Server
Exchange Server
A family of Microsoft client/server messaging and collaboration software.
1,301 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Naeem 0 Reputation points
    2024-04-02T08:11:19.7+00:00

    This is fixed.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.