Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
CreateMessage Method (MessageVersion, String, Object, XmlObjectSerializer)

Message::CreateMessage Method (MessageVersion, String, Object, XmlObjectSerializer)

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

Namespace:  System.ServiceModel.Channels
Assemblies:   System.ServiceModel.Primitives (in System.ServiceModel.Primitives.dll)
  System.ServiceModel (in System.ServiceModel.dll)

static Message^ CreateMessage(
	MessageVersion^ version, 
	String^ action, 
	Object^ body, 
	XmlObjectSerializer^ serializer


Type: System.ServiceModel.Channels::MessageVersion

A MessageVersion object that specifies the SOAP version to use for the message.

Type: System::String

A description of how the message should be processed.

Type: System::Object

The body of the message.

Type: System.Runtime.Serialization::XmlObjectSerializer

A XmlObjectSerializer object used to serialize the message.

Return Value

Type: System.ServiceModel.Channels::Message
A Message object for the message created.


version, fault or action is nullptr.

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

When working with JSON messages use the CreateMessage(MessageVersion, String, Object, XmlObjectSerializer) method, the CreateMessage(MessageVersion, String, Object) method does not work with JSON messages.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

.NET for Windows Phone apps

Supported in: Windows Phone 8.1, Windows Phone Silverlight 8.1, Windows Phone Silverlight 8

Portable Class Library

Supported in: Portable Class Library
© 2015 Microsoft