Last post Oct 26, 2011 01:42 AM by sudeep_13
Oct 24, 2011 04:13 PM|netlynx|LINK
I have a .NET project where I'm calling a webservice passing in a XML string. The output from the webservice is also a string and I need to save it to a folder on my harddrive:
Dim startDate As String = General.DetermineDate(#9/1/2011#)
Dim endDate As String = General.DetermineDate(#9/2/2011#)
xmlDoc = General.CreateXML("299011052800007", startDate, endDate)
xmlString = xmlDoc.OuterXml.ToString
mdm.Credentials = System.Net.CredentialCache.DefaultCredentials
userToken = New UsernameToken(username, pwd, PasswordOption.SendPlainText)
wsResult = mdm.Export(xmlString)
I want to be able to save wsResult (the return from the webservice call).
This is probably something easy to do, but I have not worked on XML for a while now. Can you help?
Oct 25, 2011 04:13 AM|sudeep_13|LINK
Use the XmlDocument object and call the Save method to write to the xml file on folder. Pls see below link for code sample
XmlDocument xdoc= new XmlDocument();
Oct 25, 2011 10:47 PM|decker dong - msft|LINK
Just to tell you (I'm afraid you are a bit careless)……XmlDocument.Load will load a file or a Stream instead of loading an xml contents. Accroding to what the author requests, it should use LoadXml to load xml contents and do saving.
Hope this helps.
But anyway, thanks sudeep_13 VERY MUCH!
Oct 26, 2011 01:42 AM|sudeep_13|LINK
Thanks Decker Dong for correcting.