Writing XML into URL using dataset( Windows Application)
-
Hi all, How to write a xml file into Remote URL using its NetWorkCredentials(userid & password) ? Please suggest me. Thanks in advance cheers kvsekhar
-
Hi all, How to write a xml file into Remote URL using its NetWorkCredentials(userid & password) ? Please suggest me. Thanks in advance cheers kvsekhar
-
So... you want to upload a file to a server? you could create an FTP for the server
Life goes very fast. Tomorrow, today is already yesterday.
Thanks for your suggestion. Is it not possible using DataSet.WriteXml(url) ? because I could able to read xml file from url by following code
XmlUrlResolver resolver = new XmlUrlResolver(); NetworkCredential nc = new NetworkCredential("id", "pwd"); resolver.Credentials = nc; // Get a Stream object containing the XML file. Uri myUri = new Uri("http://domain/Assessments/Expenses.xml"); Stream s = (Stream)resolver.GetEntity(myUri, null, typeof(Stream)); // Construct a reader using the Stream object. XmlTextReader xmlTextReader = new XmlTextReader(s); XmlDataDocument xdoc1 = new XmlDataDocument(); xdoc1.DataSet.ReadXml(xmlTextReader, XmlReadMode.Auto); DataSet ds = xdoc1.DataSet;
How this logic will be applied for Writing XML to URL ? -
Thanks for your suggestion. Is it not possible using DataSet.WriteXml(url) ? because I could able to read xml file from url by following code
XmlUrlResolver resolver = new XmlUrlResolver(); NetworkCredential nc = new NetworkCredential("id", "pwd"); resolver.Credentials = nc; // Get a Stream object containing the XML file. Uri myUri = new Uri("http://domain/Assessments/Expenses.xml"); Stream s = (Stream)resolver.GetEntity(myUri, null, typeof(Stream)); // Construct a reader using the Stream object. XmlTextReader xmlTextReader = new XmlTextReader(s); XmlDataDocument xdoc1 = new XmlDataDocument(); xdoc1.DataSet.ReadXml(xmlTextReader, XmlReadMode.Auto); DataSet ds = xdoc1.DataSet;
How this logic will be applied for Writing XML to URL ?im not sure if it is possible to write to a file like you are suggesting, and if it was possible it would more than likely require permissions to be set on the server for that kind of write access.
Life goes very fast. Tomorrow, today is already yesterday.