[corlib] Assume UTC if no $TZ set. Fixes #30360
[mono.git] / mcs / class / System.ServiceModel / Test / System.ServiceModel.Channels / BinaryMessageEncodingBindingElementTest.cs
1 //
2 // BinaryMessageEncodingBindingElementTest.cs
3 //
4 // Author:
5 //      Atsushi Enomoto <atsushi@ximian.com>
6 //
7 // Copyright (C) 2009 Novell, Inc.  http://www.novell.com
8 //
9 // Permission is hereby granted, free of charge, to any person obtaining
10 // a copy of this software and associated documentation files (the
11 // "Software"), to deal in the Software without restriction, including
12 // without limitation the rights to use, copy, modify, merge, publish,
13 // distribute, sublicense, and/or sell copies of the Software, and to
14 // permit persons to whom the Software is furnished to do so, subject to
15 // the following conditions:
16 // 
17 // The above copyright notice and this permission notice shall be
18 // included in all copies or substantial portions of the Software.
19 // 
20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
23 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
24 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27 //
28 using System;
29 using System.Collections.ObjectModel;
30 using System.IO;
31 using System.Net.Sockets;
32 using System.ServiceModel;
33 using System.ServiceModel.Channels;
34 using System.ServiceModel.Description;
35 using System.Text;
36 using System.Xml;
37 using NUnit.Framework;
38
39 using Element = System.ServiceModel.Channels.BinaryMessageEncodingBindingElement;
40
41 namespace MonoTests.System.ServiceModel.Channels
42 {
43         [TestFixture]
44         public class BinaryMessageEncodingBindingElementTest
45         {
46                 [Test]
47                 public void DefaultValues ()
48                 {
49                         Element el = new Element ();
50                         Assert.AreEqual (64, el.MaxReadPoolSize, "#1");
51                         Assert.AreEqual (16, el.MaxWritePoolSize, "#2");
52                         Assert.AreEqual (MessageVersion.Default, el.MessageVersion, "#3");
53                         // FIXME: test ReaderQuotas
54                 }
55
56                 [Test]
57                 [ExpectedException (typeof (ArgumentNullException))]
58                 public void BuildChannelListenerNullArg ()
59                 {
60                         new Element ().BuildChannelListener<IReplyChannel> (null);
61                 }
62
63                 [Test]
64                 public void CanBuildChannelFactory ()
65                 {
66                         CustomBinding cb = new CustomBinding (
67                                 new HttpTransportBindingElement ());
68                         BindingContext ctx = new BindingContext (
69                                 cb, new BindingParameterCollection ());
70                         Element el = new Element ();
71                         Assert.IsTrue (el.CanBuildChannelFactory<IRequestChannel> (ctx), "#1");
72                         Assert.IsFalse (el.CanBuildChannelFactory<IRequestSessionChannel> (ctx), "#2");
73                 }
74
75                 [Test]
76                 public void BuildChannelFactory ()
77                 {
78                         CustomBinding cb = new CustomBinding (
79                                 new HttpTransportBindingElement ());
80                         BindingContext ctx = new BindingContext (
81                                 cb, new BindingParameterCollection ());
82                         Element el = new Element ();
83                         IChannelFactory<IRequestChannel> cf =
84                                 el.BuildChannelFactory<IRequestChannel> (ctx);
85                 }
86
87                 [Test]
88                 [ExpectedException (typeof (InvalidOperationException))]
89                 public void BuildChannelListenerEmptyCustomBinding ()
90                 {
91                         CustomBinding cb = new CustomBinding ();
92                         BindingContext ctx = new BindingContext (
93                                 cb, new BindingParameterCollection ());
94                         new Element ().BuildChannelListener<IReplyChannel> (ctx);
95                 }
96
97                 [Test]
98                 public void BuildChannelListenerWithTransport ()
99                 {
100                         CustomBinding cb = new CustomBinding (
101                                 new HttpTransportBindingElement ());
102                         BindingContext ctx = new BindingContext (
103                                 cb, new BindingParameterCollection (),
104                                 new Uri ("http://localhost:8080"), String.Empty, ListenUriMode.Unique);
105                         new Element ().BuildChannelListener<IReplyChannel> (ctx);
106                 }
107
108                 [Test]
109                 [ExpectedException (typeof (ProtocolException))]
110                 public void ReadMessageWrongContentType ()
111                 {
112                         var encoder = new BinaryMessageEncodingBindingElement ().CreateMessageEncoderFactory ().Encoder;
113                         encoder.ReadMessage (new MemoryStream (new byte [0]), 100, "application/octet-stream");
114                 }
115
116                 [Test]
117                 public void ReadMessage ()
118                 {
119                         using (var ms = File.OpenRead ("Test/System.ServiceModel.Channels/binary-message.raw")) {
120
121                                 var session = new XmlBinaryReaderSession ();
122                                 byte [] rsbuf = new BinaryFrameSupportReader (ms).ReadSizedChunk ();
123                                 int count = 0;
124                                 using (var rms = new MemoryStream (rsbuf, 0, rsbuf.Length)) {
125                                         var rbr = new BinaryReader (rms, Encoding.UTF8);
126                                         while (rms.Position < rms.Length)
127                                                 session.Add (count++, rbr.ReadString ());
128                                 }
129                                 var xr = XmlDictionaryReader.CreateBinaryReader (ms, BinaryFrameSupportReader.soap_dictionary, new XmlDictionaryReaderQuotas (), session);
130
131                                 string soapNS = "http://www.w3.org/2003/05/soap-envelope";
132                                 string addrNS = "http://www.w3.org/2005/08/addressing";
133                                 string xmlnsNS = "http://www.w3.org/2000/xmlns/";
134                                 string peerNS = "http://schemas.microsoft.com/net/2006/05/peer";
135
136                                 xr.MoveToContent ();
137                                 AssertNode (xr, 0, XmlNodeType.Element, "s", "Envelope", soapNS, String.Empty, "#1");
138                                 Assert.AreEqual (2, xr.AttributeCount, "#1-1-1");
139                                 Assert.IsTrue (xr.MoveToAttribute ("s", xmlnsNS), "#1-2");
140                                 AssertNode (xr, 1, XmlNodeType.Attribute, "xmlns", "s", xmlnsNS, soapNS, "#2");
141                                 Assert.IsTrue (xr.MoveToAttribute ("a", xmlnsNS), "#2-2");
142                                 AssertNode (xr, 1, XmlNodeType.Attribute, "xmlns", "a", xmlnsNS, addrNS, "#3");
143                                 Assert.IsTrue (xr.Read (), "#3-2");
144                                 AssertNode (xr, 1, XmlNodeType.Element, "s", "Header", soapNS, String.Empty, "#4");
145                                 Assert.IsTrue (xr.Read (), "#4-2");
146                                 AssertNode (xr, 2, XmlNodeType.Element, "a", "Action", addrNS, String.Empty, "#5");
147                                 Assert.IsTrue (xr.MoveToAttribute ("mustUnderstand", soapNS), "#5-2");
148                                 AssertNode (xr, 3, XmlNodeType.Attribute, "s", "mustUnderstand", soapNS, "1", "#6");
149                                 Assert.IsTrue (xr.Read (), "#6-2");
150                                 AssertNode (xr, 3, XmlNodeType.Text, "", "", "", "http://schemas.microsoft.com/net/2006/05/peer/resolver/Resolve", "#7");
151                                 Assert.IsTrue (xr.Read (), "#7-2");
152                                 AssertNode (xr, 2, XmlNodeType.EndElement, "a", "Action", addrNS, String.Empty, "#8");
153                                 Assert.IsTrue (xr.Read (), "#8-2");
154                                 AssertNode (xr, 2, XmlNodeType.Element, "a", "MessageID", addrNS, String.Empty, "#9");
155                                 Assert.IsTrue (xr.Read (), "#9-2");
156                                 Assert.AreEqual (XmlNodeType.Text, xr.NodeType, "#10");
157                                 Assert.IsTrue (xr.Read (), "#10-2");
158                                 AssertNode (xr, 2, XmlNodeType.EndElement, "a", "MessageID", addrNS, String.Empty, "#11");
159                                 Assert.IsTrue (xr.Read (), "#11-2"); // -> a:ReplyTo
160                                 AssertNode (xr, 2, XmlNodeType.Element, "a", "ReplyTo", addrNS, String.Empty, "#12");
161                                 xr.Skip (); // -> a:To
162                                 AssertNode (xr, 2, XmlNodeType.Element, "a", "To", addrNS, String.Empty, "#13");
163                                 xr.Skip (); // -> /s:Header
164                                 AssertNode (xr, 1, XmlNodeType.EndElement, "s", "Header", soapNS, String.Empty, "#14");
165
166                                 Assert.IsTrue (xr.Read (), "#14-2");
167                                 AssertNode (xr, 1, XmlNodeType.Element, "s", "Body", soapNS, String.Empty, "#15");
168                                 Assert.IsTrue (xr.Read (), "#15-2");
169                                 AssertNode (xr, 2, XmlNodeType.Element, "", "Resolve", peerNS, String.Empty, "#16");
170                                 Assert.IsTrue (xr.MoveToAttribute ("xmlns"), "#16-2");
171                                 AssertNode (xr, 3, XmlNodeType.Attribute, "", "xmlns", xmlnsNS, peerNS, "#17");
172                                 Assert.IsTrue (xr.Read (), "#17-2");
173                                 AssertNode (xr, 3, XmlNodeType.Element, "", "ClientId", peerNS, String.Empty, "#18");
174 /*
175                                 while (!xr.EOF) {
176                                         xr.Read ();
177                                         Console.WriteLine ("{0}: {1}:{2} {3} {4}", xr.NodeType, xr.Prefix, xr.LocalName, xr.NamespaceURI, xr.Value);
178                                         for (int i = 0; i < xr.AttributeCount; i++) {
179                                                 xr.MoveToAttribute (i);
180                                                 Console.WriteLine ("  Attribute: {0}:{1} {2} {3}", xr.Prefix, xr.LocalName, xr.NamespaceURI, xr.Value);
181                                         }
182                                 }
183 */
184                         }
185                 }
186
187                 [Test]
188                 public void ConnectionTcpTransport ()
189                 {
190                         var host = new ServiceHost (typeof (Foo));
191                         var bindingsvc = new CustomBinding (new BindingElement [] {
192                                 new BinaryMessageEncodingBindingElement (),
193                                 new TcpTransportBindingElement () });
194                         host.AddServiceEndpoint (typeof (IFoo), bindingsvc, "net.tcp://localhost:37564/");
195                         host.Description.Behaviors.Find<ServiceBehaviorAttribute> ().IncludeExceptionDetailInFaults = true;
196                         host.Open (TimeSpan.FromSeconds (5));
197                         try {
198                                 for (int i = 0; i < 2; i++) {
199                                         var bindingcli = new NetTcpBinding ();
200                                         bindingcli.Security.Mode = SecurityMode.None;
201                                         var cli = new ChannelFactory<IFooClient> (bindingcli, new EndpointAddress ("net.tcp://localhost:37564/")).CreateChannel ();
202                                         Assert.AreEqual ("test for echo", cli.Echo ("TEST FOR ECHO"), "#1");
203                                         var sid = cli.SessionId;
204                                         Assert.AreEqual (3000, cli.Add (1000, 2000), "#2");
205                                         Assert.AreEqual (sid, cli.SessionId, "#3");
206                                         cli.Close ();
207                                 }
208                         } finally {
209                                 host.Close (TimeSpan.FromSeconds (5));
210                                 var t = new TcpListener (37564);
211                                 t.Start ();
212                                 t.Stop ();
213                         }
214                 }
215
216                 [Test]
217                 public void ConnectionHttpTransport ()
218                 {
219                         var host = new ServiceHost (typeof (Foo));
220                         var bindingsvc = new CustomBinding (new BindingElement [] {
221                                 new BinaryMessageEncodingBindingElement (),
222                                 new HttpTransportBindingElement () });
223                         host.AddServiceEndpoint (typeof (IFoo), bindingsvc, "http://localhost:37564/");
224                         host.Description.Behaviors.Find<ServiceBehaviorAttribute> ().IncludeExceptionDetailInFaults = true;
225                         host.Open (TimeSpan.FromSeconds (5));
226                         try {
227                                 for (int i = 0; i < 2; i++) {
228                                         var bindingcli = new CustomBinding (new BindingElement [] {
229                                                 new BinaryMessageEncodingBindingElement (),
230                                                 new HttpTransportBindingElement () });
231                                         var cli = new ChannelFactory<IFooClient> (bindingcli, new EndpointAddress ("http://localhost:37564/")).CreateChannel ();
232                                         Assert.AreEqual ("test for echo", cli.Echo ("TEST FOR ECHO"), "#1");
233                                         var sid = cli.SessionId;
234                                         Assert.AreEqual (3000, cli.Add (1000, 2000), "#2");
235                                         Assert.AreEqual (sid, cli.SessionId, "#3");
236                                         cli.Close ();
237                                 }
238                         } finally {
239                                 host.Close (TimeSpan.FromSeconds (5));
240                                 var t = new TcpListener (37564);
241                                 t.Start ();
242                                 t.Stop ();
243                         }
244                 }
245
246                 public interface IFooClient : IFoo, IClientChannel
247                 {
248                 }
249
250                 [ServiceContract]
251                 public interface IFoo
252                 {
253                         [OperationContract]
254                         string Echo (string msg);
255
256                         [OperationContract]
257                         uint Add (uint v1, uint v2);
258                 }
259
260                 class Foo : IFoo
261                 {
262                         public string Echo (string msg)
263                         {
264                                 return msg.ToLower ();
265                         }
266
267                         public uint Add (uint v1, uint v2)
268                         {
269                                 return v1 + v2;
270                         }
271                 }
272
273                 void AssertNode (XmlReader reader, int depth, XmlNodeType nodeType, string prefix, string localName, string ns, string value, string label)
274                 {
275                         Assert.AreEqual (nodeType, reader.NodeType, label + ".NodeType");
276                         Assert.AreEqual (localName, reader.LocalName, label + ".LocalName");
277                         Assert.AreEqual (prefix, reader.Prefix, label + ".Prefix");
278                         Assert.AreEqual (ns, reader.NamespaceURI, label + ".NS");
279                         Assert.AreEqual (value, reader.Value, label + ".Value");
280                         Assert.AreEqual (depth, reader.Depth, label + ".Depth");
281                 }
282         }
283
284         class BinaryFrameSupportReader : BinaryReader
285         {
286                 public BinaryFrameSupportReader (Stream s)
287                         : base (s)
288                 {
289                 }
290                 
291                 public byte [] ReadSizedChunk ()
292                 {
293                         int length = Read7BitEncodedInt ();
294                         
295                         if (length > 65536)
296                                 throw new InvalidOperationException ("The message is too large.");
297
298                         byte [] buffer = new byte [length];
299                         Read (buffer, 0, length);
300                         
301                         return buffer;
302                 }
303
304                 // Copied from BinaryMessageEncoder.cs.
305
306                 internal static XmlDictionary soap_dictionary;
307
308                 // See [MC-NBFS] in Microsoft OSP. The strings are copied from the PDF, so the actual values might be wrong.
309                 static readonly string [] dict_strings = {
310                         "mustUnderstand", "Envelope",
311                         "http://www.w3.org/2003/05/soap-envelope",
312                         "http://www.w3.org/2005/08/addressing", "Header", "Action", "To", "Body", "Algorithm", "RelatesTo",
313                         "http://www.w3.org/2005/08/addressing/anonymous", "URI", "Reference", "MessageID", "Id", "Identifier",
314                         "http://schemas.xmlsoap.org/ws/2005/02/rm", "Transforms", "Transform", "DigestMethod", "DigestValue", "Address", "ReplyTo", "SequenceAcknowledgement", "AcknowledgementRange", "Upper", "Lower", "BufferRemaining",
315                         "http://schemas.microsoft.com/ws/2006/05/rm",
316                         "http://schemas.xmlsoap.org/ws/2005/02/rm/SequenceAcknowledgement", "SecurityTokenReference", "Sequence", "MessageNumber",
317                         "http://www.w3.org/2000/09/xmldsig#",
318                         "http://www.w3.org/2000/09/xmldsig#enveloped-signature", "KeyInfo",
319                         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
320                         "http://www.w3.org/2001/04/xmlenc#",
321                         "http://schemas.xmlsoap.org/ws/2005/02/sc", "DerivedKeyToken", "Nonce", "Signature", "SignedInfo", "CanonicalizationMethod", "SignatureMethod", "SignatureValue", "DataReference", "EncryptedData", "EncryptionMethod", "CipherData", "CipherValue",
322                         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd", "Security", "Timestamp", "Created", "Expires", "Length", "ReferenceList", "ValueType", "Type", "EncryptedHeader",
323                         "http://docs.oasis-open.org/wss/oasis-wss-wssecurity-secext-1.1.xsd", "RequestSecurityTokenResponseCollection",
324                         "http://schemas.xmlsoap.org/ws/2005/02/trust",
325                         "http://schemas.xmlsoap.org/ws/2005/02/trust#BinarySecret",
326                         "http://schemas.microsoft.com/ws/2006/02/transactions", "s", "Fault", "MustUnderstand", "role", "relay", "Code", "Reason", "Text", "Node", "Role", "Detail", "Value", "Subcode", "NotUnderstood", "qname", "", "From", "FaultTo", "EndpointReference", "PortType", "ServiceName", "PortName", "ReferenceProperties", "RelationshipType", "Reply", "a",
327                         "http://schemas.xmlsoap.org/ws/2006/02/addressingidentity", "Identity", "Spn", "Upn", "Rsa", "Dns", "X509v3Certificate",
328                         "http://www.w3.org/2005/08/addressing/fault", "ReferenceParameters", "IsReferenceParameter",
329                         "http://www.w3.org/2005/08/addressing/reply",
330                         "http://www.w3.org/2005/08/addressing/none", "Metadata",
331                         "http://schemas.xmlsoap.org/ws/2004/08/addressing",
332                         "http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous",
333                         "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault",
334                         "http://schemas.xmlsoap.org/ws/2004/06/addressingex", "RedirectTo", "Via",
335                         "http://www.w3.org/2001/10/xml-exc-c14n#", "PrefixList", "InclusiveNamespaces", "ec", "SecurityContextToken", "Generation", "Label", "Offset", "Properties", "Cookie", "wsc",
336                         "http://schemas.xmlsoap.org/ws/2004/04/sc",
337                         "http://schemas.xmlsoap.org/ws/2004/04/security/sc/dk",
338                         "http://schemas.xmlsoap.org/ws/2004/04/security/sc/sct",
339                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/RST/SCT",
340                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/RSTR/SCT", "RenewNeeded", "BadContextToken", "c",
341                         "http://schemas.xmlsoap.org/ws/2005/02/sc/dk",
342                         "http://schemas.xmlsoap.org/ws/2005/02/sc/sct",
343                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT",
344                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT",
345                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Renew",
346                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT/Renew",
347                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/SCT/Cancel",
348                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/SCT/Cancel",
349                         "http://www.w3.org/2001/04/xmlenc#aes128-cbc",
350                         "http://www.w3.org/2001/04/xmlenc#kw-aes128",
351                         "http://www.w3.org/2001/04/xmlenc#aes192-cbc",
352                         "http://www.w3.org/2001/04/xmlenc#kw-aes192",
353                         "http://www.w3.org/2001/04/xmlenc#aes256-cbc",
354                         "http://www.w3.org/2001/04/xmlenc#kw-aes256",
355                         "http://www.w3.org/2001/04/xmlenc#des-cbc",
356                         "http://www.w3.org/2000/09/xmldsig#dsa-sha1",
357                         "http://www.w3.org/2001/10/xml-exc-c14n#WithComments",
358                         "http://www.w3.org/2000/09/xmldsig#hmac-sha1",
359                         "http://www.w3.org/2001/04/xmldsig-more#hmac-sha256",
360                         "http://schemas.xmlsoap.org/ws/2005/02/sc/dk/p_sha1",
361                         "http://www.w3.org/2001/04/xmlenc#ripemd160",
362                         "http://www.w3.org/2001/04/xmlenc#rsa-oaep-mgf1p",
363                         "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
364                         "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256",
365                         "http://www.w3.org/2001/04/xmlenc#rsa-1_5",
366                         "http://www.w3.org/2000/09/xmldsig#sha1",
367                         "http://www.w3.org/2001/04/xmlenc#sha256",
368                         "http://www.w3.org/2001/04/xmlenc#sha512",
369                         "http://www.w3.org/2001/04/xmlenc#tripledes-cbc",
370                         "http://www.w3.org/2001/04/xmlenc#kw-tripledes",
371                         "http://schemas.xmlsoap.org/2005/02/trust/tlsnego#TLS_Wrap",
372                         "http://schemas.xmlsoap.org/2005/02/trust/spnego#GSS_Wrap",
373                         "http://schemas.microsoft.com/ws/2006/05/security", "dnse", "o", "Password", "PasswordText", "Username", "UsernameToken", "BinarySecurityToken", "EncodingType", "KeyIdentifier",
374                         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary",
375                         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#HexBinary",
376                         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Text",
377                         "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509SubjectKeyIdentifier",
378                         "http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ",
379                         "http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#GSS_Kerberosv5_AP_REQ1510",
380                         "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.0#SAMLAssertionID", "Assertion", "urn:oasis:names:tc:SAML:1.0:assertion",
381                         "http://docs.oasis-open.org/wss/oasis-wss-rel-token-profile-1.0.pdf#license", "FailedAuthentication", "InvalidSecurityToken", "InvalidSecurity", "k", "SignatureConfirmation", "TokenType",
382                         "http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#ThumbprintSHA1",
383                         "http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKey",
384                         "http://docs.oasis-open.org/wss/oasis-wss-soap-message-security-1.1#EncryptedKeySHA1",
385                         "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV1.1",
386                         "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLV2.0",
387                         "http://docs.oasis-open.org/wss/oasis-wss-saml-token-profile-1.1#SAMLID", "AUTH-HASH", "RequestSecurityTokenResponse", "KeySize", "RequestedTokenReference", "AppliesTo", "Authenticator", "CombinedHash", "BinaryExchange", "Lifetime", "RequestedSecurityToken", "Entropy", "RequestedProofToken", "ComputedKey", "RequestSecurityToken", "RequestType", "Context", "BinarySecret",
388                         "http://schemas.xmlsoap.org/ws/2005/02/trust/spnego",
389                         "http://schemas.xmlsoap.org/ws/2005/02/trust/tlsnego", "wst",
390                         "http://schemas.xmlsoap.org/ws/2004/04/trust",
391                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/RST/Issue",
392                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/RSTR/Issue",
393                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/Issue",
394                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/CK/PSHA1",
395                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/SymmetricKey",
396                         "http://schemas.xmlsoap.org/ws/2004/04/security/trust/Nonce", "KeyType",
397                         "http://schemas.xmlsoap.org/ws/2004/04/trust/SymmetricKey",
398                         "http://schemas.xmlsoap.org/ws/2004/04/trust/PublicKey", "Claims", "InvalidRequest", "RequestFailed", "SignWith", "EncryptWith", "EncryptionAlgorithm", "CanonicalizationAlgorithm", "ComputedKeyAlgorithm", "UseKey",
399                         "http://schemas.microsoft.com/net/2004/07/secext/WS-SPNego",
400                         "http://schemas.microsoft.com/net/2004/07/secext/TLSNego", "t",
401                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RST/Issue",
402                         "http://schemas.xmlsoap.org/ws/2005/02/trust/RSTR/Issue",
403                         "http://schemas.xmlsoap.org/ws/2005/02/trust/Issue",
404                         "http://schemas.xmlsoap.org/ws/2005/02/trust/SymmetricKey",
405                         "http://schemas.xmlsoap.org/ws/2005/02/trust/CK/PSHA1",
406                         "http://schemas.xmlsoap.org/ws/2005/02/trust/Nonce", "RenewTarget", "CancelTarget", "RequestedTokenCancelled", "RequestedAttachedReference", "RequestedUnattachedReference", "IssuedTokens",
407                         "http://schemas.xmlsoap.org/ws/2005/02/trust/Renew",
408                         "http://schemas.xmlsoap.org/ws/2005/02/trust/Cancel",
409                         "http://schemas.xmlsoap.org/ws/2005/02/trust/PublicKey", "Access", "AccessDecision", "Advice", "AssertionID", "AssertionIDReference", "Attribute", "AttributeName", "AttributeNamespace", "AttributeStatement", "AttributeValue", "Audience", "AudienceRestrictionCondition", "AuthenticationInstant", "AuthenticationMethod", "AuthenticationStatement", "AuthorityBinding", "AuthorityKind", "AuthorizationDecisionStatement", "Binding", "Condition", "Conditions", "Decision", "DoNotCacheCondition", "Evidence", "IssueInstant", "Issuer", "Location", "MajorVersion", "MinorVersion", "NameIdentifier", "Format", "NameQualifier", "Namespace", "NotBefore", "NotOnOrAfter", "saml", "Statement", "Subject", "SubjectConfirmation", "SubjectConfirmationData", "ConfirmationMethod", "urn:oasis:names:tc:SAML:1.0:cm:holder-of-key", "urn:oasis:names:tc:SAML:1.0:cm:sender-vouches", "SubjectLocality", "DNSAddress", "IPAddress", "SubjectStatement", "urn:oasis:names:tc:SAML:1.0:am:unspecified", "xmlns", "Resource", "UserName", "urn:oasis:names:tc:SAML:1.1:nameid-format:WindowsDomainQualifiedName", "EmailName", "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", "u", "ChannelInstance",
410                         "http://schemas.microsoft.com/ws/2005/02/duplex", "Encoding", "MimeType", "CarriedKeyName", "Recipient", "EncryptedKey", "KeyReference", "e",
411                         "http://www.w3.org/2001/04/xmlenc#Element",
412                         "http://www.w3.org/2001/04/xmlenc#Content", "KeyName", "MgmtData", "KeyValue", "RSAKeyValue", "Modulus", "Exponent", "X509Data", "X509IssuerSerial", "X509IssuerName", "X509SerialNumber", "X509Certificate", "AckRequested",
413                         "http://schemas.xmlsoap.org/ws/2005/02/rm/AckRequested", "AcksTo", "Accept", "CreateSequence",
414                         "http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequence", "CreateSequenceRefused", "CreateSequenceResponse",
415                         "http://schemas.xmlsoap.org/ws/2005/02/rm/CreateSequenceResponse", "FaultCode", "InvalidAcknowledgement", "LastMessage",
416                         "http://schemas.xmlsoap.org/ws/2005/02/rm/LastMessage", "LastMessageNumberExceeded", "MessageNumberRollover", "Nack", "netrm", "Offer", "r", "SequenceFault", "SequenceTerminated", "TerminateSequence",
417                         "http://schemas.xmlsoap.org/ws/2005/02/rm/TerminateSequence", "UnknownSequence",
418                         "http://schemas.microsoft.com/ws/2006/02/tx/oletx", "oletx", "OleTxTransaction", "PropagationToken",
419                         "http://schemas.xmlsoap.org/ws/2004/10/wscoor", "wscoor", "CreateCoordinationContext", "CreateCoordinationContextResponse", "CoordinationContext", "CurrentContext", "CoordinationType", "RegistrationService", "Register", "RegisterResponse", "ProtocolIdentifier", "CoordinatorProtocolService", "ParticipantProtocolService",
420                         "http://schemas.xmlsoap.org/ws/2004/10/wscoor/CreateCoordinationContext",
421                         "http://schemas.xmlsoap.org/ws/2004/10/wscoor/CreateCoordinationContextResponse",
422                         "http://schemas.xmlsoap.org/ws/2004/10/wscoor/Register",
423                         "http://schemas.xmlsoap.org/ws/2004/10/wscoor/RegisterResponse",
424                         "http://schemas.xmlsoap.org/ws/2004/10/wscoor/fault", "ActivationCoordinatorPortType", "RegistrationCoordinatorPortType", "InvalidState", "InvalidProtocol", "InvalidParameters", "NoActivity", "ContextRefused", "AlreadyRegistered",
425                         "http://schemas.xmlsoap.org/ws/2004/10/wsat", "wsat",
426                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Completion",
427                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Durable2PC",
428                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Volatile2PC", "Prepare", "Prepared", "ReadOnly", "Commit", "Rollback", "Committed", "Aborted", "Replay",
429                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Commit",
430                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Rollback",
431                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Committed",
432                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Aborted",
433                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepare",
434                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Prepared",
435                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/ReadOnly",
436                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/Replay",
437                         "http://schemas.xmlsoap.org/ws/2004/10/wsat/fault", "CompletionCoordinatorPortType", "CompletionParticipantPortType", "CoordinatorPortType", "ParticipantPortType", "InconsistentInternalState", "mstx", "Enlistment", "protocol", "LocalTransactionId", "IsolationLevel", "IsolationFlags", "Description", "Loopback", "RegisterInfo", "ContextId", "TokenId", "AccessDenied", "InvalidPolicy", "CoordinatorRegistrationFailed", "TooManyEnlistments", "Disabled", "ActivityId",
438                         "http://schemas.microsoft.com/2004/09/ServiceModel/Diagnostics",
439                         "http://docs.oasis-open.org/wss/oasis-wss-kerberos-token-profile-1.1#Kerberosv5APREQSHA1",
440                         "http://schemas.xmlsoap.org/ws/2002/12/policy", "FloodMessage", "LinkUtility", "Hops",
441                         "http://schemas.microsoft.com/net/2006/05/peer/HopCount", "PeerVia",
442                         "http://schemas.microsoft.com/net/2006/05/peer", "PeerFlooder", "PeerTo",
443                         "http://schemas.microsoft.com/ws/2005/05/routing", "PacketRoutable",
444                         "http://schemas.microsoft.com/ws/2005/05/addressing/none",
445                         "http://schemas.microsoft.com/ws/2005/05/envelope/none",
446                         "http://www.w3.org/2001/XMLSchema-instance",
447                         "http://www.w3.org/2001/XMLSchema", "nil", "type", "char", "boolean", "byte", "unsignedByte", "short", "unsignedShort", "int", "unsignedInt", "long", "unsignedLong", "float", "double", "decimal", "dateTime", "string", "base64Binary", "anyType", "duration", "guid", "anyURI", "QName", "time", "date", "hexBinary", "gYearMonth", "gYear", "gMonthDay", "gDay", "gMonth", "integer", "positiveInteger", "negativeInteger", "nonPositiveInteger", "nonNegativeInteger", "normalizedString", "ConnectionLimitReached",
448                         "http://schemas.xmlsoap.org/soap/envelope/", "Actor", "Faultcode", "Faultstring", "Faultactor", "Detail"
449                 };
450
451                 static BinaryFrameSupportReader ()
452                 {
453                         var d = new XmlDictionary ();
454                         soap_dictionary = d;
455                         foreach (var s in dict_strings)
456                                 d.Add (s);
457                 }
458         }
459 }