Serializes and deserializes an object, or an entire graph of connected objects, in SOAP format.
Assembly: System.Runtime.Serialization.Formatters.Soap (in System.Runtime.Serialization.Formatters.Soap.dll)
Thetype exposes the following members.
|SoapFormatter()||Initializes a new instance of the class with default property values.|
|SoapFormatter(ISurrogateSelector, StreamingContext)||Initializes a new instance of the class with the specified ISurrogateSelector and StreamingContext.|
|AssemblyFormat||Gets or sets the behavior of the deserializer with regards to finding and loading assemblies.|
|Binder||Gets or sets the SerializationBinder that controls the binding of a serialized object to a type.|
|Context||Gets or sets the StreamingContext used with this .|
|FilterLevel||Gets or sets the TypeFilterLevel of automatic deserialization for .NET Framework remoting.|
|SurrogateSelector||Gets or sets the SurrogateSelector that controls type substitution during serialization and deserialization.|
|TopObject||Gets or sets the ISoapMessage into which the SOAP top object is deserialized.|
|TypeFormat||Gets or sets the format in which type descriptions are laid out in the serialized stream.|
|Deserialize(Stream)||Deserializes the data on the provided stream and reconstitutes the graph of objects.|
|Deserialize(Stream, HeaderHandler)||Deserializes the stream into an object graph with any headers in that stream being handled by the given HeaderHandler.|
|Equals(Object)||Determines whether the specified object is equal to the current object. (Inherited from Object.)|
|GetHashCode||Serves as the default hash function. (Inherited from Object.)|
|GetType||Gets the Type of the current instance. (Inherited from Object.)|
|Serialize(Stream, Object)||Serializes an object or graph of objects with the specified root to the given Stream.|
|Serialize(Stream, Object, Header)||Serializes an object or graph of objects with the specified root to the given Stream in the SOAP Remote Procedure Call (RPC) format.|
|ToString||Returns a string that represents the current object. (Inherited from Object.)|
Beginning with the .NET Framework 2.0, this class is obsolete. Use BinaryFormatter instead.
The and BinaryFormatter classes implement the IRemotingFormatter interface to support remote procedure calls (RPCs), and the IFormatter interface (inherited by the IRemotingFormatter) to support serialization of a graph of objects. The class also supports RPCs with ISoapMessage objects, without using the IRemotingFormatter functionality.
During RPCs, the IRemotingFormatter interface allows the specification of two separate object graphs: the graph of objects to serialize, and an additional graph that contains an array of header objects that convey information about the remote function call (for example, transaction ID or a method signature). For proper serialization, the root object of the first graph must be an object that implements either the IMethodCallMessage interface or the IMethodReturnMessage interface.
During deserialization of an RPC, a HeaderHandler delegate is specified to the Deserialize method of the formatter. The remoting infrastructure uses the HeaderHandler delegate to produce an object that supports the ISerializable interface. This object contains the information stored in the headers, and becomes the root of the graph returned by the deserializer.
The can also handle RPCs that are produced with objects that implement the ISoapMessage interface. To create an RPC without using the IRemotingFormatter functionality, place an object that supports the ISoapMessage interface at the root of a graph being serialized. To deserialize an RPC created in this manner the TopObject property must be set to another object that supports the ISoapMessage interface, and contains the relevant remote call information.
TimeSpan objects are serialized according to the ISO 8601: 1998 section 22.214.171.124.1 "Alternative" standard.
The does not support serialization compatibility between versions of the .NET Framework. Serialization between versions 1.1 and 2.0 types in the Framework often fails. The following actions can be taken to remedy this issue:
Convert to use the BinaryFormatter, which provides compatibility between 1.1 and 2.0.
Convert existing persisted data to the new format.
Convert all producers and consumers of serialized data to version 2.0.
Avoid using types that changed from 1.1 to 2.0.