469,568 Members | 1,395 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,568 developers. It's quick & easy.

XmlTextReader problem

Hi

I have a http xml post that I'm trying to read using xmltextreader.

This is the xml:
<?xml version="1.0"?>
<userlist ACTION="newuser" VENDORNAME="H2Digital">
<amouser AMOAID="101" AMOUSERNAME="Billy hill" AMOAROLES="Student"
AMOAPRODUCTS="intralase,VISX,ILASKI" />
</userlist>

This is the code I'm using to read this
Page.Response.ContentType = "text/xml"

stream = New System.IO.StreamReader(Page.Request.InputStream)

Dim reader As System.Xml.XmlTextReader = New
System.Xml.XmlTextReader(stream)

Do While reader.Read()

When the code gets to line - 'Do while reader.read' - I get exception that
root element is missing - but xml file does have a root element.

I noticed when watching the reader during debug that the linenumber and
lineposition has strange character '&HO' in it.

This was all working fine for a while and then suddenly the reader started
up with this.

Does anyone know what is going on?

Thanks,

CindyH
Jun 27 '08 #1
2 1318
Hi

I just wanted to add that during debugging I'm getting 0 length and 0
position on page.request.inputstream.

Page.Request.InputStream.Length()

Page.Request.InputStream.Position

So its kind of looking like for some reason the page.request.inputstream
stopped working.

Thanks,

Cindy


"CindyH" <ch*******@new.rr.comwrote in message
news:O2**************@TK2MSFTNGP06.phx.gbl...
Hi

I have a http xml post that I'm trying to read using xmltextreader.

This is the xml:
<?xml version="1.0"?>
<userlist ACTION="newuser" VENDORNAME="H2Digital">
<amouser AMOAID="101" AMOUSERNAME="Billy hill" AMOAROLES="Student"
AMOAPRODUCTS="intralase,VISX,ILASKI" />
</userlist>

This is the code I'm using to read this
Page.Response.ContentType = "text/xml"

stream = New System.IO.StreamReader(Page.Request.InputStream)

Dim reader As System.Xml.XmlTextReader = New
System.Xml.XmlTextReader(stream)

Do While reader.Read()

When the code gets to line - 'Do while reader.read' - I get exception that
root element is missing - but xml file does have a root element.

I noticed when watching the reader during debug that the linenumber and
lineposition has strange character '&HO' in it.

This was all working fine for a while and then suddenly the reader started
up with this.

Does anyone know what is going on?

Thanks,

CindyH


Jun 27 '08 #2
CindyH wrote:
I just wanted to add that during debugging I'm getting 0 length and 0
position on page.request.inputstream.

Page.Request.InputStream.Length()

Page.Request.InputStream.Position

So its kind of looking like for some reason the page.request.inputstream
stopped working.
Use a tool like ethereal to check whether the HTTP request really is a
POST request with a request body.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Meir S. | last post: by
4 posts views Thread by Andy Neilson | last post: by
5 posts views Thread by Geoff Bennett | last post: by
1 post views Thread by edi | last post: by
2 posts views Thread by Q | last post: by
4 posts views Thread by Paul Bromley | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.