WebResponse response = req.GetResponse();
Stream responseStream = (response.GetResponseStream());
XmlDocument xDoc = new XmlDocument();
XmlTextReader myXMLReader = null;
myXMLReader = new XmlTextReader(response.GetResponseStream());
xDoc.Load(myXMLReader);
In myXMLReader i m getting none but xDoc do have innertext as xml document.
i wan to use this xdoc to create a datatable but nodes doesnot get selected.
I use following code but it give 0 always inspite of having data in my xdoc.
int f = (xDoc.SelectNodes("//Result/node()")).Count;
my xmldocument(xDoc) document is like
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><SearchResponse xmlns="http://stellatravelgateway.stellatravelservices.co.uk/AirService"><SearchResult Success="true" ErrorCode="0" ErrorDescription="" ResultSetID="41584558-7197-4d79-a45b-17a83c1936b3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><Results><Result><AirResult ResultItemID="0" Operator="BA" From="LGW" To="BCN" FromName="London Gatwick, London, Great Britain" ToName="Barcelona, Barcelona, Spain" AirlineClass="O" OperatorName="British Airways" CabinClass="Economy" HasAvailability="true" FareType="Published" MinStayCode="" MaxStayCode="" MinStayDescription="" MaxStayDescription="" AdultGross="61.50" AdultTax="78.59" AdultTotal="140.09" AdultCommission="0.00" ChildGross="61.50" ChildTax="78.59" ChildTotal="140.09" ChildCommission="0.00" InfantGross="10.00" InfantTax="37.59" InfantTotal="47.59" InfantCommission="0.00" TotalGross="133.00" TotalCommission="0.00" TotalTax="194.77" AdultPaxCount="1" ChildPaxCount="1" InfantPaxCount="1"><Conditions>...........
ifound that this namespace line is crteating problem .
<SearchResponse xmlns="http://stellatravelgateway.stellatravelservices.co.uk/AirService">
i want to use foreach loop on nodes.
what to do with this
Please help