本文整理汇总了C#中System.ServiceModel.EnvelopeVersion类的典型用法代码示例。如果您正苦于以下问题:C# EnvelopeVersion类的具体用法?C# EnvelopeVersion怎么用?C# EnvelopeVersion使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
EnvelopeVersion类属于System.ServiceModel命名空间,在下文中一共展示了EnvelopeVersion类的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
//引入命名空间
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.ArgumentReferenceException.
//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();
}
}
}
输出:
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)