473,387 Members | 1,423 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

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.ClearContent();
Response.ClearHeaders();

Response.ContentType = "text/xml";
Response.ContentEncoding = Encoding.UTF8;
String returnXML = "<LIST><ITEM><CODE>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/EmitXMLToBrowser.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
Jan 15 '08 #1
1 1827
Ok, I know what is causing the error. In the web.config file if I replace
<authentication mode="Forms">
<forms name="LOGINFORM" loginUrl="login.aspx" protection="All" timeout="60" />
</authentication>
<authorization>
<deny users="?" />
</authorization>

with <authentication mode="Windows"/>

it works fine!!!

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

Thanks
Jan 15 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

8
by: Rich Grise | last post by:
I think I've finally found a tutorial that can get me started: http://www.zib.de/Visual/people/mueller/Course/Tutorial/tutorial.html and I've been lurking for awhile as well. What happened is,...
1
by: klj_mcsd | last post by:
Trying to convert from VBScript to VB.NET to work in my ASP.NET app Set stream = server.CreateObject("ADODB.Stream") stream.Type = adTypeBinary stream.Open stream.LoadFromFile...
7
by: Dica | last post by:
i've used the sample code from msdn to create an encyption/decryption assembly as found here: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnnetsec/html/SecNetHT10.asp i'm...
2
by: Dave | last post by:
Hello. I need to load an URL and save it to a file in Asp.Net. The function below is creating the file, but isn't putting the data in it. Also the data is binary, so I'm not sure if I need to...
1
by: vba man | last post by:
I've used the following code to open a browser window and read the data to a file. I know there is another way using a query, but that doesn't work for this application. What I'd like to be able...
2
by: microdevsolutions | last post by:
Hello I've seen examples to read a file from somewhere into a HttpWebRequest object then write it to a HttpWebResponse object then stream it into a Stream object, very similar to the following...
16
by: matt | last post by:
I have used some free code for listing files for download, but I want to send an email to the administrator when the file has been downloaded. I have got some code in here that does it, but it will...
5
by: vimal.424 | last post by:
Hi......all.... can any body tell me how can we upload excel file & send the excel file data in database. I;m not able to do........please help me...... thanks in advance
5
by: dm3281 | last post by:
Hello, I have a text report from a mainframe that I need to parse. The report has about a 2580 byte header that contains binary information (garbage for the most part); although there are a...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.