XML Reader

M

MDB

Hello all, I am having problems reading XML and keep getting this error:

{"This is an unexpected token. The expected token is 'NAME'. Line 1,
position 21." }

Can anyone help? Here is the XML and the code I am using. I get the error
at the ds.read line.



xml = said:



XmlTextReader reader = new XmlTextReader(new StringReader(sMessage));

System.Data.DataSet ds = new DataSet();

ds.ReadXml(reader);
 
A

Alex Yakhnin [MVP]

You have a few problems in the xml: remove all comas, the CONNECT closing
tag is missing.
This one worked for me:

<?xml version="1.0" encoding="utf-8" ?>
- <BODY>
<CONNECT Confirmation="YES" Listen="YES" Service="Messaging"
NetworkService="myservice" Host="myHost" />
</BODY>
 
M

MDB

That did it! Thank you for your help.

Alex Yakhnin said:
You have a few problems in the xml: remove all comas, the CONNECT closing
tag is missing.
This one worked for me:

<?xml version="1.0" encoding="utf-8" ?>
- <BODY>
<CONNECT Confirmation="YES" Listen="YES" Service="Messaging"
NetworkService="myservice" Host="myHost" />
</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