This documentation is archived and is not being maintained.

MsmqIntegrationBinding.SerializationFormat Property

Gets or sets the serialization format to be used to serialize or deserialize the message.

Namespace:  System.ServiceModel.MsmqIntegration
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public MsmqMessageSerializationFormat SerializationFormat { get; set; }

Property Value

Type: System.ServiceModel.MsmqIntegration.MsmqMessageSerializationFormat
A MsmqMessageSerializationFormat object that represents the type of serialization to use.

This property returns an enumeration value that specifies how a message will be serialized and deserialized. For more information, see MsmqMessageSerializationFormat.

The following code illustrates how to set the serialization format on an instance of the MsmqIntegrationBinding class:

// Create the purchase order.
PurchaseOrder po = new PurchaseOrder();
po.customerId = "";
po.poNumber = Guid.NewGuid().ToString();

PurchaseOrderLineItem lineItem1 = new PurchaseOrderLineItem();
lineItem1.productId = "Blue Widget";
lineItem1.quantity = 54;
lineItem1.unitCost = 29.99F;

PurchaseOrderLineItem lineItem2 = new PurchaseOrderLineItem();
lineItem2.productId = "Red Widget";
lineItem2.quantity = 890;
lineItem2.unitCost = 45.89F;

po.orderLineItems = new PurchaseOrderLineItem[2];
po.orderLineItems[0] = lineItem1;
po.orderLineItems[1] = lineItem2;

OrderProcessorClient client = new OrderProcessorClient("OrderResponseEndpoint");
MsmqMessage<PurchaseOrder> ordermsg = new MsmqMessage<PurchaseOrder>(po);
using (TransactionScope scope = new TransactionScope(TransactionScopeOption.Required))

Console.WriteLine("Order has been submitted:{0}", po);

//Closing the client gracefully closes the connection and cleans up resources.

Console.WriteLine("Press <ENTER> to terminate client.");

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.