Validate method

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

Implementation

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

  EwsUtilities.ValidateParam(this.SmtpAddresses, "smtpAddresses");
  EwsUtilities.ValidateParam(this.Settings, "settings");

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

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

  for (String smtpAddress in this.SmtpAddresses!) {
    if (StringUtils.IsNullOrEmpty(smtpAddress)) {
      throw new ServiceValidationException(
          "Strings.InvalidAutodiscoverSmtpAddress");
    }
  }
}