New test.
[mono.git] / mcs / class / System.ServiceModel / System.ServiceModel.Channels / AddressingVersion.cs
1 //
2 // System.ServiceModel.AddressingVersion.cs
3 //
4 // Author: Duncan Mak (duncan@novell.com)
5 //
6 // Copyright (C) 2005 Novell, Inc (http://www.novell.com)
7 //
8 // Permission is hereby granted, free of charge, to any person obtaining
9 // a copy of this software and associated documentation files (the
10 // "Software"), to deal in the Software without restriction, including
11 // without limitation the rights to use, copy, modify, merge, publish,
12 // distribute, sublicense, and/or sell copies of the Software, and to
13 // permit persons to whom the Software is furnished to do so, subject to
14 // the following conditions:
15 // 
16 // The above copyright notice and this permission notice shall be
17 // included in all copies or substantial portions of the Software.
18 // 
19 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
22 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
23 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
24 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
25 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 //
27
28 using System;
29 using System.ServiceModel;
30
31 namespace System.ServiceModel.Channels
32 {
33         public sealed class AddressingVersion
34         {
35                 string name;
36                 string address;
37                 string fault_ns;
38
39                 AddressingVersion (string name, string address, string faultNS)
40                 {
41                         this.name = name;
42                         this.address = address;
43                         this.fault_ns = faultNS;
44                 }
45
46                 static AddressingVersion addressing200408 = new AddressingVersion (
47                         "Addressing200408",
48                         "http://schemas.xmlsoap.org/ws/2004/08/addressing",
49                         "http://schemas.xmlsoap.org/ws/2004/08/addressing/fault");
50
51                 static AddressingVersion addressing1_0 = new AddressingVersion (
52                         "Addressing10",
53                         "http://www.w3.org/2005/08/addressing",
54                         "http://www.w3.org/2005/08/addressing/fault");
55
56                 static AddressingVersion none = new AddressingVersion (
57                         "AddressingNone",
58                         "http://schemas.microsoft.com/ws/2005/05/addressing/none",
59                         null);
60
61                 public static AddressingVersion WSAddressing10 {
62                         get { return addressing1_0; }
63                 }
64
65                 public static AddressingVersion WSAddressingAugust2004 {
66                         get { return addressing200408; }
67                 }
68
69                 public static AddressingVersion None {
70                         get { return none; }
71                 }
72
73                 internal string Namespace {
74                         get { return address; }
75                 }
76
77                 internal string FaultNamespace {
78                         get { return fault_ns; }
79                 }
80
81                 internal string ActionNotSupported {
82                         get { return "ActionNotSupported"; }
83                 }
84
85                 public override string ToString ()
86                 {
87                         return name + " (" + address + ")";
88                 }
89         }
90 }