public WhoisEnhancedRecord(WhoisRecord whoisRecord, string filters, string referrer) { var registrant = whoisRecord.RegistryData.Registrant; City = registrant.City; StateProvince = registrant.StateProv; Organization = registrant.Name; CountryCode2 = registrant.Country; try { Country = new CountryNameLookup.CountryNameLookup().GetCountryName(CountryCode2); } catch { Country = CountryCode2; } this.ProcessFilters(filters, referrer); this.ProcessFriendly(); this.ProcessReferrer(referrer); }
public WhoisClient(string query) { Errors = new List <KeyValuePair <string, string> >(); var webClient = new WebClient(); XmlDocument searchResult = webClient.DownloadXml(string.Format(searchUri, query)); if (!searchResult.WasLoaded()) { Errors.AddFailedLookupError(string.Format(searchUri, query)); } XmlDocument orgResult = null; var orgUri = string.Empty; if (Errors.AreEmpty()) { orgUri = searchResult["net"]["orgRef"].InnerText; orgResult = webClient.DownloadXml(orgUri); if (!orgResult.WasLoaded()) { Errors.AddFailedLookupError(orgUri); } } XmlDocument pocsSearchResult = null; if (Errors.AreEmpty()) { var pocsSearchUri = string.Format(contactsUri, orgUri); pocsSearchResult = webClient.DownloadXml(pocsSearchUri); if (!pocsSearchResult.WasLoaded()) { Errors.AddFailedLookupError(pocsSearchUri); } } List <XmlDocument> pocsResult = null; if (Errors.AreEmpty()) { pocsResult = new List <XmlDocument>(); foreach (XmlElement poc in pocsSearchResult["pocs"].ChildNodes) { var pocSearchUri = poc.InnerText; var result = webClient.DownloadXml(pocSearchUri); if (!result.WasLoaded()) { Errors.AddFailedLookupError(pocSearchUri); } else { pocsResult.Add(result); } } } if (Errors.AreEmpty()) { whoisRecord = new WhoisRecord().Translate(query, searchResult, orgResult, pocsSearchResult, pocsResult); } }
public WhoisClient(string query) { Errors = new List<KeyValuePair<string, string>>(); var webClient = new WebClient(); XmlDocument searchResult = webClient.DownloadXml(string.Format(searchUri, query)); if (!searchResult.WasLoaded()) { Errors.AddFailedLookupError(string.Format(searchUri, query)); } XmlDocument orgResult = null; var orgUri = string.Empty; if (Errors.AreEmpty()) { orgUri = searchResult["net"]["orgRef"].InnerText; orgResult = webClient.DownloadXml(orgUri); if (!orgResult.WasLoaded()) { Errors.AddFailedLookupError(orgUri); } } XmlDocument pocsSearchResult = null; if (Errors.AreEmpty()) { var pocsSearchUri = string.Format(contactsUri, orgUri); pocsSearchResult = webClient.DownloadXml(pocsSearchUri); if (!pocsSearchResult.WasLoaded()) { Errors.AddFailedLookupError(pocsSearchUri); } } List<XmlDocument> pocsResult = null; if (Errors.AreEmpty()) { pocsResult = new List<XmlDocument>(); foreach (XmlElement poc in pocsSearchResult["pocs"].ChildNodes) { var pocSearchUri = poc.InnerText; var result = webClient.DownloadXml(pocSearchUri); if (!result.WasLoaded()) { Errors.AddFailedLookupError(pocSearchUri); } else { pocsResult.Add(result); } } } if (Errors.AreEmpty()) { whoisRecord = new WhoisRecord().Translate(query, searchResult, orgResult, pocsSearchResult, pocsResult); } }