return Xml?
-
i know a site alway return xml then is there any built-in class & method that help me to store the xml in a string variable, i will just pass the site url to the method.please help me with sample code. tbhattacharjee
-
i know a site alway return xml then is there any built-in class & method that help me to store the xml in a string variable, i will just pass the site url to the method.please help me with sample code. tbhattacharjee
HttpWebRequest req = (HttpWebRequest)WebRequest.Create(address); req.ContentType ="application/x-www-form-urlencoded"; req.Method= "POST"; Stream stream = req.GetRequestStream(); ASCIIEncoding encoding=new ASCIIEncoding(); byte[] byte1=encoding.GetBytes(message); stream.Write(byte1,0,byte1.Length); stream.Close(); WebResponse resp = req.GetResponse(); Stream respStream = resp.GetResponseStream(); StreamReader rdr = new StreamReader( respStream,System.Text.Encoding.ASCII ); string strResponse = rdr.ReadToEnd(); message is your XML structured string and strResponse is XML structured Response