Validate method

  1. @override
void Validate()
override
Validates the request.

Implementation

@override
void Validate() {
  super.Validate();

  EwsUtilities.ValidateParam(this.Domains, "domains");
  EwsUtilities.ValidateParam(this.Settings, "settings");

  if (this.Settings!.length == 0) {
    throw new ServiceValidationException(
        "Strings.InvalidAutodiscoverSettingsCount");
  }

  if (_domains!.length == 0) {
    throw new ServiceValidationException(
        "Strings.InvalidAutodiscoverDomainsCount");
  }

  for (String domain in this._domains!) {
    if (StringUtils.IsNullOrEmpty(domain)) {
      throw new ServiceValidationException(
          "Strings.InvalidAutodiscoverDomain");
    }
  }
}