XmlTextReader problem

C

CindyH

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
 
C

CindyH

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
 
M

Martin Honnen

CindyH said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top