Reader Level:

WCF SOAP Message Version

By Dhananjay Kumar on Jun 16, 2011
Services and their clients communicate using messages. So they must use compatible message versions to communicate. A service may send a message either as POX or as SOAP12.

Services and their clients communicate using messages. So they must use compatible message versions to communicate. A service may send a message either as POX or as SOAP12.

When at the service side we create a SOAP Message, we call it a Message Object Model. Essentially, we can say a Message Object Model is used to create a SOAP Message in WCF to communicate with a client. When we create a SOAP Message, we specify the message version and it is not modifiable afterwards.

A message created using a Message Object Model essentially consists of an Envelope version and an Addressing version type.


The MessageVersion class is inside System.ServiceModel.Channels. If you navigate to the MessageVersion class you will find AddressingVersion and EnvelopeVersion there.


The Message versions are as below:


If you want you can create your own Message Version:


CreateVersion is an overloaded function. Either you can pass only Envelope Version or Envelope Version and Addressing Version both to create your own Message Version.

Now let us inspect the entire Message version to find what Envelope Version and AddressingVersion type are inside a particular Message Version.

using System;
using System.ServiceModel.Channels;
namespace XML
    class Program
        static void Main(string[] args)
            MessageVersion version = MessageVersion.Default;
            Display(version ,"Default");
            version = MessageVersion.Soap11 ;
            version = MessageVersion.Soap11WSAddressing10 ;
            version = MessageVersion.Soap11WSAddressingAugust2004;
            version = MessageVersion.Soap12 ;
            version= MessageVersion.Soap12WSAddressing10;

        static void Display(MessageVersion v , string strName)
            Console.WriteLine("Addressing : " + v.Addressing.ToString());
            Console.WriteLine("Envelope : " + v.Envelope.ToString());

If you run the above code you will get output as below:


If you want to create a new Message Version, you can very much do that.


If you want you can pass as an input parameter only EnvelopeVersion:


Note: Display is a function to print EnevelopeVesrion and AddressingVesrion. This function is created in the code shown previously.

If you run the above code you will get output as below:


I hope you are now getting an idea about SOAP Message Versions. In the next post, we will see more about messages in WCF.

I hope this post was useful. Thanks for reading.

Dhananjay  Kumar
Dhananjay Kumar

Dhananjay kumar is 6 times Microsoft MVP, 7 times C# Corner MVP. He works as consultant for Infragistics in India. He is known for mentoring teams on various technologies.

Personal Blog:



Custom Software Development
MCN is your source for developing solutions involving websites, mobile apps, cloud-computing, databases, BI, back-end services and processes and client-server applications.

Trending up

Infragistics jQuery Controls