// /api/office365ips?servicename=o365&addresstype=ipv4 public IEnumerable <String> GetIPsbyService(string serviceName, string addressType) { Office365IPs _IPs = new Office365IPs(); addressTypeEnum _addressType; if (Enum.TryParse(addressType, true, out _addressType)) { System.Collections.ObjectModel.Collection <string> IPs = new System.Collections.ObjectModel.Collection <string>(); string xpath = "/products/product[@name =\"" + serviceName + "\"]/addresslist[@type=\"" + _addressType.ToString() + "\"]"; XmlNodeList addresses = WebApiApplication.Office365XML.SelectNodes(xpath); foreach (XmlNode address in addresses) { foreach (XmlNode childNode in address.ChildNodes) { _IPs.Add(childNode.InnerText); } } } return(_IPs); }
// api/office365ips/ public IEnumerable <String> GetIPs() { Office365IPs _IPs = new Office365IPs(); return(_IPs); }