【问题标题】:Add an appointment in Exchange Server by using Exchange Web Services Api 2.0 and Java使用 Exchange Web Services Api 2.0 和 Java 在 Exchange Server 中添加约会
【发布时间】:2015-04-17 16:21:04
【问题描述】:

我想使用 Java 和 Exchange Web Services Api 2.0 在我的 Exchange server 2013 中添加一个新约会。

但我总是有这个例外:

线程“main”中的异常 microsoft.exchange.webservices.data.ServiceRequestException: 请求失败。请求失败。证书中的主机名没有 匹配: != 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();

【问题讨论】:

    标签: java web-services exchangewebservices exchange-server-2013


    【解决方案1】:

    这听起来像是 SSL 问题。您正在使用与 SSL 证书中配置的主机名不匹配的 URL 访问服务器,因此 API 会给出该错误。就像您浏览到该 URL 一样,由于证书名称不匹配,您会收到一条警告,询问您是否希望继续。尝试使用与证书匹配的 URL。

    【讨论】:

      猜你喜欢
      • 2012-01-14
      • 1970-01-01
      • 2011-04-07
      • 2016-11-15
      • 2010-09-17
      • 2013-03-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多