AutodiscoverUrlWithCallback method
Future<void>
AutodiscoverUrlWithCallback(
- String emailAddress,
- AutodiscoverRedirectionUrlValidationCallback validateRedirectionUrlCallback
Implementation
Future<void> AutodiscoverUrlWithCallback(
String emailAddress,
AutodiscoverRedirectionUrlValidationCallback
validateRedirectionUrlCallback) async {
Uri exchangeServiceUrl;
if (this.RequestedServerVersion.index >
ExchangeVersion.Exchange2007_SP1.index) {
try {
exchangeServiceUrl = await this
.GetAutodiscoverUrlWithExchangeVersionAndCallback(emailAddress,
this.RequestedServerVersion, validateRedirectionUrlCallback);
this.Url = this.AdjustServiceUriFromCredentials(exchangeServiceUrl);
return;
} on AutodiscoverLocalException catch (ex) {
this.TraceMessage(enumerations.TraceFlags.AutodiscoverResponse,
"Autodiscover service call failed with error '${ex.message}'. Will try legacy service");
} on ServiceRemoteException catch (ex) {
// Special case: if the caller's account is locked we want to return this exception, not continue.
if (ex is AccountIsLockedException) {
throw ex;
}
this.TraceMessage(enumerations.TraceFlags.AutodiscoverResponse,
"Autodiscover service call failed with error '${ex.message}'. Will try legacy service");
}
}
// Try legacy Autodiscover provider
exchangeServiceUrl = await this
.GetAutodiscoverUrlWithExchangeVersionAndCallback(emailAddress,
ExchangeVersion.Exchange2007_SP1, validateRedirectionUrlCallback);
this.Url = this.AdjustServiceUriFromCredentials(exchangeServiceUrl);
}