Quantcast
Channel: Active questions tagged header - Stack Overflow
Viewing all articles
Browse latest Browse all 794

How to get the XML in MVC with raw body and headers

$
0
0

` public async ActionResult Index(){List amadeuslist = new List();string xmlbody = "<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"...;var client = new RestClient("https://nodeA3.test.webservices.amadeus.com/1ASIWSCCJ2");var request = new RestRequest();request.AddHeader("SOAPAction", "http://webservices.amadeus.com/1ASIWWCIJ2/VLSSLQ_06_1_1A");request.AddHeader("Content-Type", " text/xml; charset=utf-8");request.AddStringBody(xmlbody, "application/xml");var response = await client.PostAsync(request);

   XmlDocument doc1 = new XmlDocument();       doc1.Load(client);       XmlElement root = doc1.DocumentElement;       XmlNodeList nodes = root.SelectNodes("/soap:Envelope/soap:Header/awss:Session");       AmadeusModel amad;       foreach (XmlNode crn in nodes)       {           amad = new AmadeusModel();           amad.SessionID = crn["awss:SessionId"].InnerText;           amad.SecurityToken = crn["awss:SecurityToken"].InnerText;           amadeuslist.Add(amad);       }   return View(amadeuslist);`

I'm trying to get security ID and Security Token from this code, the system is showing problem in class name "Index", and I can't debug the application and load the result to XMLDOCUMENT.


Viewing all articles
Browse latest Browse all 794

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>