>>>XmlSerializer xmlizer = new XmlSerializer(typeof(SearchResponse)); >>>StringWriter sw = new StringWriter(); >>>xmlizer.Serialize(sw, iw.SearchResponse); >>>>>
>>FileStream fs = new FileStream("c:/xmlresponse2.xml", FileMode.Create); >>fs.Write(m_searchresponse.Manifest[0].Content.Value, 0, m_searchresponse.Manifest[0].Content.Value.Length); >>fs.Close(); >>>>
>string result = System.Text.Encoding.ASCII.GetString(m_searchresponse.Manifest[0].Content.Value); >Thanks Paul. You are correct in assuming that the object is a byte[]. Your command worked except for one small issue. At the end of the string is some text that messes up the html. It is:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" > <head><title> Untitled Page </title></head> <body> <form name="form1" method="post" action="Default.aspx" id="form1"> <div> <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUJNzgzNDMwNTMzZGTDH6DkceZcgjl3lgkIoHipA0YqKg==" /> </div> <div> </div> </form> </body> </html>If I remove it manually things are good. Any idea why this "extra junk" is getting there?