我得到的 EWS URL 如下:
var response = myAutodiscoverService.GetUserSettings(
"userA@domain.com",
UserSettingName.ExternalEwsUrl,
UserSettingName.InternalEwsUrl,
UserSettingName.EwsSupportedSchemas);
string settingValue;
if (response.TryGetSettingValue(UserSettingName.ExternalEwsUrl, out settingValue)
|| response.TryGetSettingValue(UserSettingName.InternalEwsUrl, out settingValue))
{
// If ExternalEwsUrl is not returned in the response,
// we consider InternalEwsUrl for auto-discover
string ewsurl = settingValue;
}
现在,我正在缓存我收到的这个请求,因为自动发现真的很慢。当这个 ewsurl 过期时会发生什么(因为假设用户的邮箱被移动到不同的端点)。为了实施失败机制来获取新的更新的 ews url,我应该期待什么错误?
编辑:我正在使用 ews url 订阅 EWS 上的新邮件事件,ExchangeService.SubscribeToPushNotifications
所以我还有一个问题,假设如果在用户订阅通知后 ews url 发生了更改,我是否会收到该用户关于新邮件事件的通知我的应用程序的回调 url?