System.ServiceModel 4.0.0.0 System.Object System.IDisposable

The class provides a means of communicating arbitrary information between a sender and a receiver on a network. It can be used to relay information, suggest or demand a course of action, or request data.

The structure of a object represents a SOAP envelope. It consists of two distinct parts: the message's body and an optional collection of headers, represented by the class. The message content is application-defined data sent from a sender to a receiver. The message headers enable system and application extensibility to meet the changing requirements, because you can define code to manipulate and respond to specific headers. You can also define your own headers. Message headers are serialized or deserialized along with the contents of the message.

Messages are received and sent in particular formats. Support is provided for two formats: the standard text-based XML format and a binary-based XML format. The object can be used to represent both SOAP 1.1 and SOAP 1.2 envelopes. Note that an instance of is fixed upon creation and is bound to a specific SOAP version. The property represents the SOAP version of the message.

A object can be serialized to an external store by using the method. Properties of the message can also be serialized, but they have to be individually identified and serialized separately. Deserializing a message to create an in-memory object can be done using . Properties must also be deserialized individually and manually added to the property collection for the specific instance.

The size of a object is fixed to the size of data it is transmitting. Every body is modeled as an instance of , with no predefined limit on the size of the stream that the instance is wrapping. However, specific channel providers can have a limit on the size of messages that they process.

A can be annotated with useful information generated by an entity that has examined and processed the message. This functionality is provided by the and properties. The collection represents the set of SOAP headers on the message.

The property represents the set of processing-level annotations on the message. Because information in headers is transmitted on the wire, an entity that examines a header must support the underlying version(s) of the protocols used by the header. However, properties provide a more version-independent way of annotating a message.

To create a instance, use one of the methods.

It is recommended that a consumer of a message always call when the consumer is finished accessing the contents of the message. This action frees finite system resources (for example, sockets, named pipes) that are tied to the lifetime of the message.

Special note for Managed C++ users deriving from this class:

Put your cleanup code in (On)(Begin)Close (and/or OnAbort), not in a destructor.

Avoid destructors: they cause the compiler to auto-generate .

Avoid non-reference members: they can cause the compiler to auto-generate .

Avoid finalizers; but if you include one, suppress the build warning and call and the finalizer itself from (On)(Begin)Close (and/or OnAbort) to emulate what would have been the auto-generated behavior.

Represents the unit of communication between endpoints in a distributed environment.

- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

- Method
  4.0.0.0
  System.Void

  The does have a finalizer, which causes to be called for you when the message is garbage-collected. This is non-optimal, as the .NET Framework's Garbage Collection (GC) mechanism does not necessarily run when you run out of system resources other than memory. For this reason, you should always call this method when finished with the contents of the message. The method is a synonym for (which also implements). The message also disposes the object that was used to construct the body when it is disposed.

  An is thrown if you call any method or access any properties of the message once it is closed. Calling any method or accessing any properties of other objects related to the message once it is closed, (such as message header collection, message property values, or instances returned for the body or for a header) has undefined behavior.

  Closes the and releases any resources.

- Method
  4.0.0.0
  System.ServiceModel.Channels.MessageBuffer ``

  The body of a instance can only be accessed or written once. If you want to access a instance more than once, you should use the class to completely store an entire instance into memory. A instance is constructed by calling of a instance.

  If is equal to , this method only stores the body of the message, not the entire message into the memory buffer.

  Stores an entire into a memory buffer for future access.

  A newly created object.

  The maximum size of the buffer to be created.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` ``

  This static method is used to create a new copy of message ready for sending.

  Creates a message that contains a version and an action.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A description of how the message should be processed.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  This static method is used to create a new copy of message ready for sending.

  Creates a message that contains a SOAP fault, a version and an action.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A object that represents a SOAP fault. A description of how the message should be processed.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  This static method is used to create a new copy of message ready for sending.

  When working with JSON messages use the method, the method does not work with JSON messages.

  Creates a message with the specified version, action and body.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A description of how the message should be processed. The body of the message.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  An empty message is useful for an endpoint to send an alert to another endpoint without any actual content.

  Creates a message with a body that consists of an array of bytes.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A description of how the message should be processed. A of type byte.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  This static method is used to create a new copy of message ready for sending.

  Creates a message with the specified version, action and body.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A description of how the message should be processed. The body of the message.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  This static method is used to create a new copy of message ready for sending.

  Creates a message using the specified reader, action and version.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A description of how the message should be processed. The object to be used for reading the SOAP message.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  takes ownership of

  This method reads the envelope, buffers all the headers into the header collection, and reads up to but not including the Body start tag, and returns the message. If the method call throws an exception, it closes the reader.

  The body of the returned message can then be either read or written.

  The message body can be read using the methods on the returned message. The returned object encapsulates all the child elements within the Body element. The message body can be written using or . Once written, it cannot be read.

  Closing the message closes the underlying envelope reader.

  Creates a message using the specified reader, action and version.

  A object for the message created.

  The object to be used for reading the SOAP message. The maximum size in bytes of a header. A valid value that specifies the SOAP version to use for the message.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` ``

  takes ownership of

  This method reads the envelope, buffers all the headers into the header collection, and reads up to but not including the Body start tag, and returns the message. If the method call throws an exception, it closes the reader.

  The body of the returned message can then be either read or written.

  The message body can be read using the methods on the returned message. The returned object encapsulates all the child elements within the Body element. The message body can be written using or . Once written, it cannot be read.

  Closing the message closes the underlying envelope reader.

  Creates a message using the specified reader, action and version.

  A object for the message created.

  The object to be used for reading the SOAP message. The maximum size in bytes of a header. A object that specifies the SOAP version to use for the message.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` `` `` To be added.

  This static method is used to create a new copy of message ready for sending.

  Creates a message that contains a SOAP fault, the reason for the fault, a version and an action.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. The reason of the SOAP fault. A description of how the message should be processed.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` `` `` To be added.

  This static method is used to create a new copy of message ready for sending.

  When working with JSON messages use the method, the method does not work with JSON messages.

  Creates a message using the specified version, action, message body and serializer.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. A description of how the message should be processed. The body of the message.
- Method
  4.0.0.0
  System.ServiceModel.Channels.Message `` `` `` `` `` To be added.

  This static method is used to create a new copy of message ready for sending.

  Creates a message that contains a SOAP fault, a reason and the detail for the fault, a version and an action.

  A object for the message created.

  A object that specifies the SOAP version to use for the message. The reason of the SOAP fault. The details of the SOAP fault. A description of how the message should be processed.
- Method
  4.0.0.0
  T

  A instance has a body that corresponds to the SOAP body. It can be accessed as an by calling . It is initially positioned directly after the <S:Body> element, and it returns EOF on reaching the </S:Body> element. Alternatively, if you expect the body to contain a serialized object, you can call instead. You should be aware that a message body can only be accessed once and a message can only be written once. If you want to access the Body multiple times, use to create a instance.

  Use the overload when working with JSON messages; the overload does not work.

  Retrieves the body of this instance.

  An object of type that contains the body of this message.

  The body of the message.
- Method
  4.0.0.0
  T `` To be added.

  A instance has a body that corresponds to the SOAP body. It can be accessed as an by calling . It is initially positioned directly after the <S:Body> element, and it returns EOF on reaching the </S:Body> element. Alternatively, if you expect the body to contain a serialized object, you can call instead. You should be aware that a message body can only be accessed once and a message can only be written once. If you want to access the body multiple times, use to create a instance.

  Use the overload when working with JSON messages; the overload does not work.

  Retrieves the body of this using the specified serializer.

  An object of type that contains the body of this message.

  The body of the message.
- Method
  4.0.0.0
  System.String `` ``

  A instance has a body that corresponds to the SOAP body. It can be accessed as an by calling . It is initially positioned directly after the <S:Body> element, and it returns EOF on reaching the </S:Body> element. Alternatively, if you expect the body to contain a serialized object, you can call instead. You should be aware that a message body can only be accessed once and a message can only be written once. If you want to access the body multiple times, use to create a instance.

  Retrieves the attributes of the message body.

  The attributes of the message body.

  The local name of the XML node. The namespace to which this XML element belongs.
- Method
  4.0.0.0
  System.Xml.XmlDictionaryReader

  A instance has a body that corresponds to the SOAP body. It can be accessed as an by calling . It is initially positioned directly after the <S:Body> element. Alternatively, if you expect the body to contain a serialized object, you can call instead. You should be aware that a message body can only be accessed once and a message can only be written once. If you want to access the body multiple times, use to create a instance.

  Gets the XML dictionary reader that accesses the body content of this message.

  A object that accesses the body content of this message.

- Property
  4.0.0.0
  System.ServiceModel.Channels.MessageHeaders To be added.

  A can have zero or more headers that are used as an extension mechanism to pass information in messages that is application-specific. You can use to add message headers to a message by calling the method.

  indigo1 provides a number of predefined message headers, as shown in the following table.

  Header Name

  Contains the header name.

  To

  Contains the role that the message is targeting.

  Action

  Provides a description of how the message should be processed.

  FaultTo

  Contains the address of the node to which faults should be sent.

  From

  Contains the address of the node that sent the message.

  Request

  Indicates whether the message is a request.

  MessageID

  Contains the unique ID of the message.

  RelatesTo

  Contains the IDs of messages that are related to this message.

  ReplyTo

  Contains the address of the node to which a reply should be sent for a request.

  When overridden in a derived class, gets the headers of the message.

- Property
  4.0.0.0
  System.Boolean To be added. To be added.

  Returns a value that indicates whether the is disposed.

- Property
  4.0.0.0
  System.Boolean To be added. To be added.

  Returns a value that indicates whether the is empty.

- Property
  4.0.0.0
  System.Boolean To be added. To be added.

  Gets a value that indicates whether this message generates any SOAP faults.

- Method
  4.0.0.0
  System.Void `` To be added.

  Called when the message body is converted to a string.

  A that is used to convert the message body to a string.
- Method
  4.0.0.0
  System.Void To be added.

  Called when the message is closing.

- Method
  4.0.0.0
  System.ServiceModel.Channels.MessageBuffer `` To be added.

  Called when a message buffer is created to store this message.

  A object for the newly created message copy.

  The maximum size of the buffer to be created.
- Method
  4.0.0.0
  T `` To be added.

  Called when the body of the message is retrieved.

  A that represents the body of the message.

  A object used to read the body of the message. The type of the message body.
- Method
  4.0.0.0
  System.String `` `` To be added.

  Called when the attributes of the message body is retrieved.

  The attributes of the message body.

  The local name of the XML node. The namespace to which this XML element belongs.
- Method
  4.0.0.0
  System.Xml.XmlDictionaryReader To be added.

  Called when an XML dictionary reader that accesses the body content of this message is retrieved.

  A object that accesses the body content of this message.

- Method
  4.0.0.0
  System.Void `` To be added.

  Called when the message body is written to an XML file.

  A that is used to write this message body to an XML file.
- Method
  4.0.0.0
  System.Void `` To be added.

  Called when the entire message is written to an XML file.

  A that is used to write this message to an XML file.
- Method
  4.0.0.0
  System.Void `` To be added.

  Called when the start body is written to an XML file.

  A that is used to write the start body to an XML file.
- Method
  4.0.0.0
  System.Void `` To be added.

  Called when the start envelope is written to an XML file.

  A that is used to write the start envelope to an XML file.
- Method
  4.0.0.0
  System.Void `` To be added.

  Called when the start header is written to an XML file.

  A that is used to write the start header to an XML file.
- Property
  4.0.0.0
  System.ServiceModel.Channels.MessageProperties To be added.

  Because information in headers is transmitted on the wire, an entity that examines a header must support the underlying version(s) of the protocols used by the header. However, properties provide a more version-independent way of annotating a message.

  When overridden in a derived class, gets a set of processing-level annotations to the message.

- Property
  4.0.0.0
  System.ServiceModel.Channels.MessageState To be added.

  Because the body of a object is a stream, it can only be read or written once. This is enforced by maintaining the current state of the object. A object can be read, written, or copied when in the state. Other states are , and , which means that the respective action has been performed already once.

  Gets the current state of this .

- Method
  4.0.0.0
  System.Void

  Call this method when you are finished using the . This method leaves the in an unusable state. After calling this method, you must release all references to the so the garbage collector can reclaim the memory that the resided in.

  Always call this method before you release your last reference to the . Otherwise, the resources it is using are not freed until the garbage collector calls the object's Finalize method.

  Closes all the resources used by this message. This method cannot be inherited.

- Method
  4.0.0.0
  System.String To be added.

  Returns a string that represents the current instance.

  The string representation of the current instance.

- Property
  4.0.0.0
  System.ServiceModel.Channels.MessageVersion To be added.

  This value is immutable for the message. There are two possible values for the version: and that correspond to SOAP 1.1 and SOAP 1.2 respectively.

  Knowing the underlying SOAP version is important because the structure of is firmly correlated with that of a SOAP message.

  Inheritors must note that when overridden in a derived class, this method returns a object for the SOAP version of the message.

  When overridden in a derived class, gets the SOAP version of the message.

- Method
  4.0.0.0
  System.Void ``

  This method writes the body contents as well as the start and end tags of the element.

  Writes the body element using the specified .

  An object to be used to write the body element.
- Method
  4.0.0.0
  System.Void ``

  This method writes the body contents as well as the start and end tags of the element.

  Serializes the message body using the specified .

  The object to be used to write the body of the message.
- Method
  4.0.0.0
  System.Void `` To be added.

  Serializes the body content using the specified .

  An object to be used to write the body element.
- Method
  4.0.0.0
  System.Void ``

  This method serializes the entire message. Once a message is written, it cannot be rewritten unless a instance exists for the message.

  Serializes the entire message using the specified .

  An object to be used to write the message.
- Method
  4.0.0.0
  System.Void ``

  This method serializes the entire message. Once a message is written, it cannot be rewritten unless there is a for the message.

  Serializes the entire message using the specified .

  The object to be used to write the entire message.
- Method
  4.0.0.0
  System.Void `` To be added.

  Serializes the start body of the message using the specified .

  An object to be used to write the start body.
- Method
  4.0.0.0
  System.Void `` To be added.

  Serializes the start body of the message using the specified .

  The object to be used to write the start body of the message.
- Method
  4.0.0.0
  System.Void `` To be added.

  Serializes the start envelope using the specified .

  An object to be used to write the start envelope.