ReadServerVersionInfo method

Future<ExchangeServerInfo> ReadServerVersionInfo(
  1. EwsXmlReader reader
)
Read ServerVersionInfo SOAP header. EwsXmlReader

Implementation

/* private */
Future<ExchangeServerInfo> ReadServerVersionInfo(EwsXmlReader reader) async {
  ExchangeServerInfo serverInfo = new ExchangeServerInfo();
  do {
    await reader.Read();

    if (reader.IsStartElement()) {
      switch (reader.LocalName) {
        case XmlElementNames.MajorVersion:
          serverInfo.MajorVersion = await reader.ReadElementValue<int>();
          break;
        case XmlElementNames.MinorVersion:
          serverInfo.MinorVersion = await reader.ReadElementValue<int>();
          break;
        case XmlElementNames.MajorBuildNumber:
          serverInfo.MajorBuildNumber = await reader.ReadElementValue<int>();
          break;
        case XmlElementNames.MinorBuildNumber:
          serverInfo.MinorBuildNumber = await reader.ReadElementValue<int>();
          break;
        case XmlElementNames.Version:
          serverInfo.VersionString = await reader.ReadElementValue<String>();
          break;
        default:
          break;
      }
    }
  } while (!reader.IsEndElementWithNamespace(
      XmlNamespace.Autodiscover, XmlElementNames.ServerVersionInfo));

  return serverInfo;
}