1
我正在使用EWSJavaAPI 1.1.5。我試圖用無效的憑據登錄,但我沒有任何例外。如何在EWS Java API中驗證憑證
請告知如何檢測和處理無效登錄。
這裏是我的代碼:
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();
}