Simple deserialization help needed please...
I have a packet of xml in a string, and need to get that into a
reader./stream of some sort so I can properly use deserialize..
here's my deserialization routine (its part of a property as you can tell)..
Set(ByVal Value As String)
Dim serializer As New XmlSerializer(GetType(Package))
Dim xmlstream As New MemoryStream
Dim oPackage As Package
Dim strXML() As String
Dim strChar As String
Dim bytXML() As Byte
Dim byt As Byte
' All the code in here I removed because it was a debugging and testing
jumble of garbage
' How do I got from the XML data in Value, and get that into a memory
stream, or something that the serializer will deserialze?
oPackage = CType(serializer.Deserialize(xmlstream), Package)
End Set
The data I'm trying to deserialize is (this is the Value string in the Set
above):
<?xml version="1.0"?>
<Package xmlns:xsd="http://www.w3.org/2001/XMLSchema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ID>ffec2923-e125-4693-905b-d88888c7522f</ID>
<Action>Send Message</Action>
<Data>my message</Data>
<ReceiptRequired>false</ReceiptRequired>
<Sent>2004-02-11T13:58:53.8150490-06:00</Sent>
<Source_UserLogin>test</Source_UserLogin>
<Source_UserID>ffe5f6ef-b046-4456-b140-9412345b8f47</Source_UserID>
<Source_ComputerName>shadow</Source_ComputerName>
<Source_ComputerIP>192.1.111.3</Source_ComputerIP>
<Target_UserLogin>test</Target_UserLogin>
<Target_UserID>29e5f6ef-b146-46b5-b140-94cf6666f47</Target_UserID>
<Target_ComputerName>localhost</Target_ComputerName>
<Target_ComputerIP>127.0.0.1</Target_ComputerIP>
</Package>