我想使用 Java 和 Exchange Web Services Api 2.0 在我的 Exchange server 2013 中添加一个新约会。
但我总是有这个例外:
线程“主”microsoft.exchange.webservices.data.ServiceRequestException 中的异常:请求失败。请求失败。证书中的主机名不匹配:<10.0.6.4> != ms-ex
这是我的代码的一部分:
ExchangeService service = new ExchangeService();
ExchangeCredentials credentials = new WebCredentials("userName", "password");
service.setCredentials(credentials);
service.setUrl(new URI("https:// server address/ews/exchange.asmx"));
Appointment appointment = new Appointment(service);
appointment.setSubject("Appointment subject");
.
.
.
appointment.save();