Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Data at the root level is invalid. Line 1, position 1

$
0
0

Hello,

i try to read a XML file in C# but everytime i got the Error "Data at the root level is invalid. Line 1, position 1."

I dont know how to fix it. Can anyone help me?

This is my code:

                        if ((filename.ToLower() == "lead.xml" || filename.ToLower() == "lead.xml.xml") && ent.Attributes.Contains("body"))//aktualisieren
                        {
                            byte[] data = Convert.FromBase64String(ent.Attributes["body"].ToString());
                            string xml = Encoding.UTF8.GetString(data);



                            XmlDocument doc = new XmlDocument();
                            doc.LoadXml(xml);
                            doc.PreserveWhitespace = false;
                            XmlNode root = doc.DocumentElement;

                            tracingService.Trace("läuft2");

                            foreach (XmlNode node in root)
                            {
                                if (node.Name == "recipient")
                                {...



Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images