1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176
|
//------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
//------------------------------------------------------------
namespace System.ServiceModel.Channels
{
using System.Runtime.Serialization;
using System.Xml;
using System.ServiceModel.Security;
public sealed class AddressingVersion
{
string ns;
XmlDictionaryString dictionaryNs;
MessagePartSpecification signedMessageParts;
string toStringFormat;
string anonymous;
XmlDictionaryString dictionaryAnonymous;
Uri anonymousUri;
Uri noneUri;
string faultAction;
string defaultFaultAction;
static AddressingVersion none = new AddressingVersion(AddressingNoneStrings.Namespace, XD.AddressingNoneDictionary.Namespace,
SR.AddressingNoneToStringFormat, new MessagePartSpecification(), null, null, null, null, null);
static AddressingVersion addressing10 = new AddressingVersion(Addressing10Strings.Namespace,
XD.Addressing10Dictionary.Namespace, SR.Addressing10ToStringFormat, Addressing10SignedMessageParts,
Addressing10Strings.Anonymous, XD.Addressing10Dictionary.Anonymous, Addressing10Strings.NoneAddress,
Addressing10Strings.FaultAction, Addressing10Strings.DefaultFaultAction);
static MessagePartSpecification addressing10SignedMessageParts;
static AddressingVersion addressing200408 = new AddressingVersion(Addressing200408Strings.Namespace,
XD.Addressing200408Dictionary.Namespace, SR.Addressing200408ToStringFormat, Addressing200408SignedMessageParts,
Addressing200408Strings.Anonymous, XD.Addressing200408Dictionary.Anonymous, null,
Addressing200408Strings.FaultAction, Addressing200408Strings.DefaultFaultAction);
static MessagePartSpecification addressing200408SignedMessageParts;
AddressingVersion(string ns, XmlDictionaryString dictionaryNs, string toStringFormat,
MessagePartSpecification signedMessageParts, string anonymous, XmlDictionaryString dictionaryAnonymous, string none, string faultAction, string defaultFaultAction)
{
this.ns = ns;
this.dictionaryNs = dictionaryNs;
this.toStringFormat = toStringFormat;
this.signedMessageParts = signedMessageParts;
this.anonymous = anonymous;
this.dictionaryAnonymous = dictionaryAnonymous;
if (anonymous != null)
{
this.anonymousUri = new Uri(anonymous);
}
if (none != null)
{
this.noneUri = new Uri(none);
}
this.faultAction = faultAction;
this.defaultFaultAction = defaultFaultAction;
}
public static AddressingVersion WSAddressingAugust2004
{
get { return addressing200408; }
}
public static AddressingVersion WSAddressing10
{
get { return addressing10; }
}
public static AddressingVersion None
{
get { return none; }
}
internal string Namespace
{
get { return ns; }
}
static MessagePartSpecification Addressing10SignedMessageParts
{
get
{
if (addressing10SignedMessageParts == null)
{
MessagePartSpecification s = new MessagePartSpecification(
new XmlQualifiedName(AddressingStrings.To, Addressing10Strings.Namespace),
new XmlQualifiedName(AddressingStrings.From, Addressing10Strings.Namespace),
new XmlQualifiedName(AddressingStrings.FaultTo, Addressing10Strings.Namespace),
new XmlQualifiedName(AddressingStrings.ReplyTo, Addressing10Strings.Namespace),
new XmlQualifiedName(AddressingStrings.MessageId, Addressing10Strings.Namespace),
new XmlQualifiedName(AddressingStrings.RelatesTo, Addressing10Strings.Namespace),
new XmlQualifiedName(AddressingStrings.Action, Addressing10Strings.Namespace)
);
s.MakeReadOnly();
addressing10SignedMessageParts = s;
}
return addressing10SignedMessageParts;
}
}
static MessagePartSpecification Addressing200408SignedMessageParts
{
get
{
if (addressing200408SignedMessageParts == null)
{
MessagePartSpecification s = new MessagePartSpecification(
new XmlQualifiedName(AddressingStrings.To, Addressing200408Strings.Namespace),
new XmlQualifiedName(AddressingStrings.From, Addressing200408Strings.Namespace),
new XmlQualifiedName(AddressingStrings.FaultTo, Addressing200408Strings.Namespace),
new XmlQualifiedName(AddressingStrings.ReplyTo, Addressing200408Strings.Namespace),
new XmlQualifiedName(AddressingStrings.MessageId, Addressing200408Strings.Namespace),
new XmlQualifiedName(AddressingStrings.RelatesTo, Addressing200408Strings.Namespace),
new XmlQualifiedName(AddressingStrings.Action, Addressing200408Strings.Namespace)
);
s.MakeReadOnly();
addressing200408SignedMessageParts = s;
}
return addressing200408SignedMessageParts;
}
}
internal XmlDictionaryString DictionaryNamespace
{
get { return dictionaryNs; }
}
internal string Anonymous
{
get { return anonymous; }
}
internal XmlDictionaryString DictionaryAnonymous
{
get { return dictionaryAnonymous; }
}
internal Uri AnonymousUri
{
get { return anonymousUri; }
}
internal Uri NoneUri
{
get { return noneUri; }
}
internal string FaultAction // the action for addressing faults
{
get { return faultAction; }
}
internal string DefaultFaultAction // a default string that can be used for non-addressing faults
{
get { return defaultFaultAction; }
}
internal MessagePartSpecification SignedMessageParts
{
get
{
return this.signedMessageParts;
}
}
public override string ToString()
{
return SR.GetString(toStringFormat, Namespace);
}
}
}
|