Open pipibilibili opened 2 years ago
Possibly your credential initialization is wrong, did you try the alternative contructor with domain
?
ExchangeCredentials ewsCredential = new WebCredentials(ewsUserName, ewsPassword, ewsDomain);
exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
exchangeService.setCredentials(ewsCredential);
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP2); ExchangeCredentials credentials = new WebCredentials("xxxx@163.com", "xxxxx"); service.setCredentials(credentials); service.autodiscoverUrl("xxxx@163.com");
Exception in thread "main" microsoft.exchange.webservices.data.autodiscover.exception.AutodiscoverLocalException: The Autodiscover service couldn't be located. at microsoft.exchange.webservices.data.autodiscover.AutodiscoverService.internalGetLegacyUserSettings(AutodiscoverService.java:742) at microsoft.exchange.webservices.data.autodiscover.AutodiscoverService.getLegacyUserSettings(AutodiscoverService.java:521) at microsoft.exchange.webservices.data.autodiscover.AutodiscoverService.internalGetLegacyUserSettings(AutodiscoverService.java:959) at microsoft.exchange.webservices.data.autodiscover.AutodiscoverService.getUserSettings(AutodiscoverService.java:1846) at microsoft.exchange.webservices.data.core.ExchangeService.getAutodiscoverUrl(ExchangeService.java:3615) at microsoft.exchange.webservices.data.core.ExchangeService.autodiscoverUrl(ExchangeService.java:3572) at microsoft.exchange.webservices.data.core.ExchangeService.autodiscoverUrl(ExchangeService.java:3522) at EwsTest.main(EwsTest.java:29)