Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

when i read an xml file from a web service client, it is not read properly. whereas, if i read the file from a normal web application, it is being read properly.

 

any idea why?

Posted

This is the code to read file from disk or from some where else

 

System.Xml.XmlTextReader reader = new System.Xml.XmlTextReader("c:\\IntroToVCS.xml");
        string contents = "";
        while (reader.Read()) 
        {
           reader.MoveToContent();
           if (reader.NodeType == System.Xml.XmlNodeType.Element)
              contents += "<"+reader.Name + ">\n";
           if (reader.NodeType == System.Xml.XmlNodeType.Text)
              contents += reader.Value + "\n";
        }
Console.Write(contents);

 

Please check you might be doing some thing worng while accessing the WEB Service or Parsing XML data.

The one and only

Dr. Madz

eee-m@il

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...