Freigeben über


Versioning for Addresses, Envelopes, and Messages

The versioning of a message in WCF is a combination of the versioning of the envelope format and the addressing format. In Beta 2, the versioning story is a little out-of-date from where it's going to be for the final release. That's simply due to the lag time of producing an official release. I'm going to talk about the Beta 2 versioning story in this post because that's what you can write code against at this time. Everything here is still going to be important in the future.

The addressing format is a transport-neutral mechanism for talking about the location or destination of services and messages. The mechanism for addressing in WCF is Web Services Addressing. There's two version of the WS-Addressing standard to worry about. The first version is the original August 2004 release. The second version, which is what you should really be thinking about, is the final WS-Addressing 1.0 release that came out earlier this month. This version has been tracked by WCF during development.

 public sealed class AddressingVersion
{
   public static AddressingVersion WSAddressing10 { get; }
   public static AddressingVersion WSAddressingAugust2004 { get; }

   public override bool Equals(object obj);
   public override int GetHashCode();
   public override string ToString();
}

The envelope format describes the contents of a message and how to process it. The standard envelope format for WCF is the Simple Object Access Protocol (SOAP). SOAP is an XML-based packaging format for data. By itself, SOAP doesn't really do much. SOAP relies on other web service standards to plug in and provide functionality that people want, like security, reliability, and transactions. SOAP comes in both a 1.1 flavor from May 2000 and a 1.2 flavor from June 2003. SOAP 1.2 fixes a lot of crufty bits from the earlier specification.

 public sealed class EnvelopeVersion
{
   public string NextDestinationActorValue { get; }
   public static EnvelopeVersion Soap11 { get; }
   public static EnvelopeVersion Soap12 { get; }

   public override int GetHashCode();
   public string[] GetUltimateDestinationActorValues();
   public override string ToString();
}

The message version is just a pairwise combination of the addressing and envelope formats. By default, you get the latest and greatest version of each specification. If you supply an envelope format without an addressing format, you'll get WS-Addressing 1.0. If you don't supply anything, you'll get WS-Addressing 1.0 with SOAP 1.2.

 public sealed class MessageVersion
{
   public AddressingVersion Addressing { get; }
   public static MessageVersion Default { get; }
   public EnvelopeVersion Envelope { get; }
   public static MessageVersion Soap11WSAddressing10 { get; }
   public static MessageVersion Soap11WSAddressingAugust2004 { get; }
   public static MessageVersion Soap12WSAddressing10 { get; }
   public static MessageVersion Soap12WSAddressingAugust2004 { get; }

   public static MessageVersion CreateVersion(EnvelopeVersion envelopeVersion);
   public static MessageVersion CreateVersion(EnvelopeVersion envelopeVersion, AddressingVersion addressingVersion);
   public override bool Equals(object obj);
   public override int GetHashCode();
   public override string ToString();
}

Next time: Inside the Standard Bindings: BasicHttp

Comments

  • Anonymous
    May 30, 2006
    There are two ways to think about the representation of data on a standard Ethernet network. The first...
  • Anonymous
    February 19, 2007
    I haven't forgotten about the goal to put together a table of contents for all of these articles. The