Trying to read XML stream from browser

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Laila2008
    New Member
    • Jan 2008
    • 4

    Trying to read XML stream from browser

    Hi, I'm writing a String containing XML data to my browser. The XML data is well formed and the page opens up correctly but when I try to read this data from another page I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.

    Here is the code in the page serving the XML:

    Response.Clear( );
    Response.ClearC ontent();
    Response.ClearH eaders();

    Response.Conten tType = "text/xml";
    Response.Conten tEncoding = Encoding.UTF8;
    String returnXML = "<LIST><ITEM><C ODE>24</CODE></ITEM></LIST>";
    Response.Write( returnXML);

    When I hit the above page directly there are no issues and the XML is displayed nicely in a tree.



    Here is the code from the page trying to read the XML data:

    DataSet dataSet = new DataSet();
    dataSet.ReadXml ("http://localhost:2593/MyApp/EmitXMLToBrowse r.aspx");
    this.GridView1. DataSource = dataSet;
    this.GridView1. DataMember = "ITEM";
    this.GridView1. DataBind();


    thats when I get the following error: '>' is an unexpected token. The expected token is '"' or '''. Line 2, position 63.

    Note: if I try to save returnXML to a file and read that file in dataSet.ReadXML , there are no issues.

    Any idea what is the issue here?

    Thanks
  • Laila2008
    New Member
    • Jan 2008
    • 4

    #2
    Ok, I know what is causing the error. In the web.config file if I replace
    <authenticati on mode="Forms">
    <forms name="LOGINFORM " loginUrl="login .aspx" protection="All " timeout="60" />
    </authentication>
    <authorizatio n>
    <deny users="?" />
    </authorization>

    with <authenticati on mode="Windows"/>

    it works fine!!!

    I do need forms authentication, any idea how to get this to work?

    Thanks

    Comment

    Working...