0

我正在使用com.microsoft.ews-java-api:ews-java-api:2.0在 MS Exchange 日历中创建和更新约会。两者都在我的测试环境中运行良好。在客户环境(不同的交换服务器)上创建约会工作但更新它运行以下代码会导致异常。

// Init
ExchangeService exchangeService = new ExchangeService(ExchangeVersion.Exchange2010_SP2);
WebCredentials webCredentials = new WebCredentials(exchangeUser, exchangePassword);
URI exchangeUri = new URI(exchangeUrl);
exchangeService.setCredentials(webCredentials);
exchangeService.setUrl(exchangeUri);

// Creating an appointment. This works on both environments.
Mailbox mailbox = new Mailbox("some@mail.com");
FolderId folderId = new FolderId(WellKnownFolderName.Calendar, mailbox);
Appointment appointment = new Appointment(exchangeService);
appointment.save(folderId);
// Keep ID for updating later on ...
model.setAppointmentId(appointment.getId().getUniqueId());

// ...

// Updating an appointment. This only works on my test environment.
ItemId itemId = new ItemId();
itemId.setUniqueId(model.getAppointmentId());
Appointment appointment = Appointment.bind(exchangeService, itemId); // The exception occurs here!
appointment.update(ConflictResolutionMode.AlwaysOverwrite);

这是我得到的例外

microsoft.exchange.webservices.data.core.exception.service.remote.ServiceResponseException: An internal server error occurred. The operation failed.
    at microsoft.exchange.webservices.data.core.response.ServiceResponse.internalThrowIfNecessary(ServiceResponse.java:278)
    at microsoft.exchange.webservices.data.core.response.ServiceResponse.throwIfNecessary(ServiceResponse.java:267)
    at microsoft.exchange.webservices.data.core.request.MultiResponseServiceRequest.execute(MultiResponseServiceRequest.java:165)
    at microsoft.exchange.webservices.data.core.ExchangeService.internalBindToItems(ExchangeService.java:1343)
    at microsoft.exchange.webservices.data.core.ExchangeService.bindToItem(ExchangeService.java:1378)
    at microsoft.exchange.webservices.data.core.ExchangeService.bindToItem(ExchangeService.java:1395)
    at microsoft.exchange.webservices.data.core.service.item.Appointment.bind(Appointment.java:118)
    at microsoft.exchange.webservices.data.core.service.item.Appointment.bind(Appointment.java:133)

An internal server error occurred. The operation failed.并不是一个真正有用的例外。任何想法为什么会失败?或者如何获取更多信息?

4

0 回答 0