using System.Collections.Generic;
public static void Main()
Dictionary<string,string> myDict = ParseXml(xmlString1);
Console.WriteLine("Dictionary is null");
foreach(KeyValuePair<string, string> ele2 in myDict)
Console.WriteLine("{0} and {1}", ele2.Key, ele2.Value);
public static Dictionary<string,string> ParseXml(string xmlString)
XmlDocument doc1 = new XmlDocument();
var nsManager = new XmlNamespaceManager(doc1.NameTable);
nsManager.AddNamespace("d","http://citrix.com/authentication/response/1");
nsManager.AddNamespace("wv","http://citrix.com/authentication/response/webview/1");
XmlNode node1 = doc1.DocumentElement.SelectSingleNode("//d:AuthenticateResponse/d:AuthenticationRequirements/d:PostBack", nsManager);
XmlNode node2= doc1.DocumentElement.SelectSingleNode("//d:AuthenticateResponse/d:AuthenticationRequirements/d:Requirements/d:Requirement/d:Credential/wv:WebView/wv:StartUrl",nsManager);
Dictionary<string, string> myDict = new Dictionary<string, string>();
myDict.Add("PostBack",node1.InnerText);
myDict.Add("StartUrl",node2.InnerText);
Console.WriteLine("Exception while reading configuration. \n {0}", ex.Message);
private static string xmlString1 = @"<?xml version=""1.0"" encoding=""utf-8""?>
<AuthenticateResponse xmlns=""http://citrix.com/authentication/response/1"">
<Result>more-info</Result>
<AuthenticationRequirements>
<PostBack>/CofL3V8dB0eE9LimnW5xvw/ExplicitForms</PostBack>
<CancelPostBack>/CofL3V8dB0eE9LimnW5xvw/ExplicitForms/Cancel</CancelPostBack>
<CancelButtonText>Cancel</CancelButtonText>
<ID>webviewResponseId</ID>
<wv:WebView xmlns:wv=""http://citrix.com/authentication/response/webview/1"">
<wv:StartUrl>https://accounts-dsauthweb-internal.cloud.com/CofL3V8dB0eE9LimnW5xvw/oidc/webview</wv:StartUrl>
<Label><Type>none</Type></Label>
</AuthenticationRequirements>
</AuthenticateResponse>";