B
Ben Turner
I'm querying a web service to get some global weather data (http://www.webservicex.net/globalweather.asmx?WSDL) which works really well, however I'm getting stuck on the returned data for the GetWeather call.
The data returned is presented as a string but actually contains XML data. I'd like to treat the data as XML, and then save it to a file, append other results etc. so I can re-use the data later without having to requery the server (to save time etc.)
But I'm really new to XML and don't know where to start. I've managed to get the data into an XML with the code shown at the bottom, but I need to manipulate the XML (add some nodes, change some, delete some etc.) and I'd really like to do this before I save the file, rather than save it, then re-load it.
Is there a simple way I can just create an XML object (XMLDocument?) and just drop the contents of the string into it? Thanks.
sWeatherXML = wsNewWeather.GetWeather("Las Vegas", "United States")
Dim fs As New FileStream("Weather.xml", FileMode.OpenOrCreate)
Dim xw As New XmlTextWriter(fs, Nothing)
xw.WriteStartDocument()
xw.WriteRaw(sWeatherXML)
xw.Close()
Ben Turner
(e-mail address removed)
The data returned is presented as a string but actually contains XML data. I'd like to treat the data as XML, and then save it to a file, append other results etc. so I can re-use the data later without having to requery the server (to save time etc.)
But I'm really new to XML and don't know where to start. I've managed to get the data into an XML with the code shown at the bottom, but I need to manipulate the XML (add some nodes, change some, delete some etc.) and I'd really like to do this before I save the file, rather than save it, then re-load it.
Is there a simple way I can just create an XML object (XMLDocument?) and just drop the contents of the string into it? Thanks.
sWeatherXML = wsNewWeather.GetWeather("Las Vegas", "United States")
Dim fs As New FileStream("Weather.xml", FileMode.OpenOrCreate)
Dim xw As New XmlTextWriter(fs, Nothing)
xw.WriteStartDocument()
xw.WriteRaw(sWeatherXML)
xw.Close()
Ben Turner
(e-mail address removed)