Click or drag to resize

XmlStringSerializer Class

Serializes data to XML (compatible with Java).
Inheritance Hierarchy

Namespace:  Eneter.Messaging.DataProcessing.Serializing
Assembly:  Eneter.Messaging.Framework (in Eneter.Messaging.Framework.dll) Version: (
public class XmlStringSerializer : ISerializer

The XmlStringSerializer type exposes the following members.

Public methodXmlStringSerializer
Creates the serializer based on XmlSerializer with default settings.
Public methodXmlStringSerializer(FuncType, XmlSerializer)
Creates the serializer that allows user to specify his own method instantiating XmlSerializer with desired settings.
Public methodDeserialize_T
Deserializes data into the specified type.
Public methodEquals
Determines whether the specified object is equal to the current object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as the default hash function.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodSerialize_T
Serializes data to the xml string.
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
This is the default serializer used by the framework. The serializer is compatible with XmlStringSerializer from Eneter Messaging Framework for .NET. Therefore, you can use it for the communication between Java and .NET applications. The serializer does not support generic types on Java and Android platforms!
The serializer internally uses XmlSerializer provided by .Net.
Serialization and deserialization example.
// Some class to be serialized.
public class MyClass
    public int Value1 { get; set; }
    public string Value2 { get; set; }


MyClass c = new MyClass;
c.Value1 = 10;
c.Value2 = "Hello World.";


// Serialization
XmlStringSerializer aSerializer = new XmlStringSerializer();
object aSerializedObject = aSerializer.Serialize<MyClass>(c);


// Deserialization
XmlStringSerializer aSerializer = new XmlStringSerializer();
object aDeserializedObject = aSerializer.Deserialize<MyClass>(aSerializedObject);
See Also