我使用的是EWSJavaAPI 1.1.5。我正在尝试使用无效的凭据登录,但没有收到任何异常。
请建议如何检测和处理无效登录。
下面是我的代码:
String host = "myhost";
ExchangeService service = null;
try {
service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("wrongemail",
"wrongpass");
service.setCredentials(credentials);
service.setUrl(new java.net.URI("https://" + host
+ "/EWS/Exchange.asmx"));
} catch (Exception e) {
e.printStackTrace();
}发布于 2012-11-12 21:18:23
找到它,我必须将该服务绑定到一个文件夹:
Folder.bind(service, WellKnownFolderName.Inbox);如果凭据错误,则抛出HttpErrorException。
https://stackoverflow.com/questions/13344193
复制相似问题