public Add_Endpoint ( string Key, |
||
Key | string | Key used for subsequent lookups from this configuration |
Endpoint | Fully pre-constructed microservice client endpoint configuration object | |
return | void |
/// <summary> Read the microservice endpoints portion of a XML file </summary> /// <param name="readerXml"> XML Reader open to the microservice portion </param> /// <param name="config"> Configuration information </param> /// <param name="SystemBaseUrl"> Base URL for this instance </param> public static void Read_Microservices_Client_Details(XmlReader readerXml, MicroservicesClient_Configuration config, string SystemBaseUrl) { // Just step through the subtree of this while (readerXml.Read()) { if (readerXml.NodeType == XmlNodeType.Element) { switch (readerXml.Name.ToLower()) { case "add": string key = String.Empty; string url = String.Empty; string protocol = "JSON"; if (readerXml.MoveToAttribute("Key")) { key = readerXml.Value; } if (readerXml.MoveToAttribute("URL")) { url = readerXml.Value.Replace("[BASEURL]", SystemBaseUrl); } if (readerXml.MoveToAttribute("Protocol")) { protocol = readerXml.Value; } if ((!String.IsNullOrEmpty(key)) && (!String.IsNullOrEmpty(url))) { config.Add_Endpoint(key, url, protocol); } break; } } } }
private static void read_microservices_client_details(XmlReader readerXml, MicroservicesClient_Configuration config, string SystemBaseUrl) { // Just step through the subtree of this while (readerXml.Read()) { if (readerXml.NodeType == XmlNodeType.Element) { switch (readerXml.Name.ToLower()) { case "add": string key = String.Empty; string url = String.Empty; string protocol = "JSON"; if (readerXml.MoveToAttribute("Key")) key = readerXml.Value; if (readerXml.MoveToAttribute("URL")) url = readerXml.Value.Replace("[BASEURL]", SystemBaseUrl); if (readerXml.MoveToAttribute("Protocol")) protocol = readerXml.Value; if (( !String.IsNullOrEmpty(key)) && ( !String.IsNullOrEmpty(url))) config.Add_Endpoint(key, url, protocol); break; } } } }