Hi,
I am trying to get a xml file(document) from a web serveice and save.
here is my code:
string file = "C:\\temp\\MyFeed.xml";
WSRef.WS RSSFWS = new WSRef.WS();
string WSPath = "C:\\temp\\WSFeed.xml";
XmlNode result = WS.GetRSSFeed(file);
XmlDocument doc = new XmlDocument();
doc.AppendChild(result);
//doc.ImportNode(result, false);
doc.Save(WSPath);
following Exception make me crazy.
The node to be inserted is from a different document context.
and when i use doc.ImportNode(result, false); I get this:
Invalid XML document, The document does not have a root element..
help me please.
I am trying to get a xml file(document) from a web serveice and save.
here is my code:
string file = "C:\\temp\\MyFeed.xml";
WSRef.WS RSSFWS = new WSRef.WS();
string WSPath = "C:\\temp\\WSFeed.xml";
XmlNode result = WS.GetRSSFeed(file);
XmlDocument doc = new XmlDocument();
doc.AppendChild(result);
//doc.ImportNode(result, false);
doc.Save(WSPath);
following Exception make me crazy.
The node to be inserted is from a different document context.
and when i use doc.ImportNode(result, false); I get this:
Invalid XML document, The document does not have a root element..
help me please.