I'm currently writing an app that receives a byte array from a web service API, this array is basically an xml document. I'm converting it back to a string then to an xml document as follows:
VB Code:
Private Sub ConvertToString(ByVal wb() As Byte) Dim strResponse As String Dim enc As ASCIIEncoding = New ASCIIEncoding strResponse = enc.GetString(wb) rtbResult.Text = strResponse End Sub
VB Code:
Private Sub createXML() Dim xmlDoc As XmlDocument = New XmlDocument xmlDoc.LoadXml(rtbResult.Text) xmlDoc.Save("c:\XMLResult.xml") End Sub()
Please bear in mind this is still in a 'getting to grips stage'.
The question is twofold, one is there a better way to convert the byte array directly to an xml document?
Secondly I originally thought about loading the xml data into a dataset and then manipluating it from there but the xml document is fairly complex and the dataset.readxml method throws an error about duplicate tables being created.
Is it feasible to just utilise the data directly from the xml document its self and if so does this slow things down any ?
I'm pretty green when it comes to xml so any advice appreciated.





Reply With Quote