SOAP Serialization

SOAP serialization works similarly to binary serialization. First, you need to add a reference to the System.Runtime.Serialization.Formatters.Soap.dll assembly. Then you add an Imports System.Runtime.Serialization.Formatters.Soap directive. Then you can serialize and deserialize your objects. To continue the example of the typed collection shown in the previous section, write the following code to accomplish serialization with the SOAP formatter:

'Requires an Imports System.Runtime.Serialization.Formatters.Soap directiveDim stringToSerialize As String = "Serialization demo with VB"Dim targetFile As New FileStream("C:\temp\SerializedData.xml",                                 FileMode.Create)Dim ...

Get Visual Basic 2015 Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.