Export (0) Print
Expand All

EnvelopeVersion Class

Contains information related to the version of SOAP associated with a message and its exchange.

System.Object
  System.ServiceModel.EnvelopeVersion

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

public sealed class EnvelopeVersion

The EnvelopeVersion type exposes the following members.

  NameDescription
Public propertySupported by Portable Class LibrarySupported in .NET for Windows Store appsNextDestinationActorValueGets a string that contains the URI name for the SOAP role associated with the current message version for the next destination.
Public propertyStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsNoneGets the envelope version not using a version of SOAP.
Public propertyStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsSoap11Gets the SOAP1.1 envelope version.
Public propertyStatic memberSupported by Portable Class LibrarySupported in .NET for Windows Store appsSoap12Gets the SOAP1.2 envelope version.
Top

  NameDescription
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsEquals(Object)Determines whether the specified object is equal to the current object. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetHashCodeServes as the default hash function. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetTypeGets the Type of the current instance. (Inherited from Object.)
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsGetUltimateDestinationActorValuesGets a string that contains the URI name for the SOAP role associated with the current message version for the ultimate destination.
Public methodSupported by Portable Class LibrarySupported in .NET for Windows Store appsToStringGets a string that represents the current envelope version. (Overrides Object.ToString().)
Top

The SOAP versions currently available are SOAP 1.1 and SOAP 1.2. There is an EnvelopeVersion for each of these versions of SOAP that can be recovered using the Soap11 and Soap12 properties. There is also a None message version that is used to sent and receive XML messages that do not use SOAP formatting. The processing roles associated with each message version can be recovered using the NextDestinationActorValue property and the GetUltimateDestinationActorValues method.

The following code shows how to access the methods and properties of EnvelopeVersion.


using System;
using System.Collections.Generic;
using System.ServiceModel;
using System.Text;

namespace CS
{
    class Program
    {
        static void Main(string[] args)
        {

     // MessageVersion
     EnvelopeVersion envS11 = EnvelopeVersion.Soap11;
     string nextDestS11 = envS11.NextDestinationActorValue;
     string[] ultDestsS11 = envS11.GetUltimateDestinationActorValues();
     string ultS11 = ultDestsS11[0];
     string toStrS11 = envS11.ToString();

     EnvelopeVersion envS12 = EnvelopeVersion.Soap12;

     EnvelopeVersion envNotSOAP =  EnvelopeVersion.None;

     string nextDestS12 = envS12.NextDestinationActorValue;

     string[] ultDestsS12 = envS12.GetUltimateDestinationActorValues();

     string ultS12 = ultDestsS12[1];

     string toStrS12 = envS12.ToString();

     EnvelopeVersion envNone = EnvelopeVersion.None;
     string nextDestNone = envNone.NextDestinationActorValue;
     //The following code throws a System.ArgumentReferenceExeption. 
     //The object reference is not set to an instance of an object 
     // string[] ultDestsNone = envNone.GetUltimateDestinationActorValues(); 
     string toStrNone = envNone.ToString();

     //EnvelopeVersions
     Console.WriteLine("EnvelopeVersion.Soap11: {0}", envS11);
     Console.WriteLine("EnvelopeVersion.Soap12: {0}", envS12);
     Console.WriteLine("EnvelopeVersion.None: {0}", envNone);
     Console.WriteLine();

     //NextDestination
     Console.WriteLine("NextDest EnvelopeVersion.Soap11: {0}", nextDestS11);
     Console.WriteLine("NextDest EnvelopeVersion.Soap12: {0}", nextDestS12);
     Console.WriteLine("NextDest EnvelopeVersion.None: {0}", nextDestNone);
     Console.WriteLine();

     //UltimateDestinations
     Console.WriteLine("UltDest EnvelopeVersion.Soap11: {0}", ultS11);
     Console.WriteLine("UltDest EnvelopeVersion.Soap12: {0}", ultS12);
     //Console.WriteLine("UltDest EnvelopeVersion.None: {0}", ultDestsNone);
     Console.WriteLine();

     //ToString
     Console.WriteLine("EnvelopeVersion.Soap11.ToString(): {0}", toStrS11);
     Console.WriteLine("EnvelopeVersion.Soap11.ToString(): {0}", toStrS12);
      Console.WriteLine("EnvelopeVersion.Soap11.ToString(): {0}", toStrNone);
      Console.WriteLine();

        }
    }
}
/*
 * 
 * 
 * 
Output:
EnvelopeVersion.Soap11: Soap11 (http://schemas.xmlsoap.org/soap/envelope/)
EnvelopeVersion.Soap12: Soap12 (http://www.w3.org/2003/05/soap-envelope)
EnvelopeVersion.None: EnvelopeNone (http://schemas.microsoft.com/ws/2005/05/envelope/none)

NextDest EnvelopeVersion.Soap11: http://schemas.xmlsoap.org/soap/actor/next
NextDest EnvelopeVersion.Soap12: http://www.w3.org/2003/05/soap-envelope/role/next
NextDest EnvelopeVersion.None:

UltDest EnvelopeVersion.Soap11:
UltDest EnvelopeVersion.Soap12:

EnvelopeVersion.Soap11.ToString(): Soap11 (http://schemas.xmlsoap.org/soap/envelope/)
EnvelopeVersion.Soap11.ToString(): Soap12 (http://www.w3.org/2003/05/soap-envelope)
EnvelopeVersion.Soap11.ToString(): EnvelopeNone (http://schemas.microsoft.com/ws/2005/05/envelope/none)
*/

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Portable Class Library

Supported in: Portable Class Library

.NET for Windows Store apps

Supported in: Windows 8

.NET for Windows Phone apps

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

Windows Phone 8.1, Windows Phone 8, Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

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

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft