2009-03-27 Zoltan Varga <vargaz@gmail.com>
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / SoapDocumentMethodAttribute.cs
1 // 
2 // System.Web.Services.Protocols.SoapDocumentMethodAttribute.cs
3 //
4 // Author:
5 //   Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2002
8 //
9
10 //
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
18 // 
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
21 // 
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30
31 using System.Web.Services.Description;
32
33 namespace System.Web.Services.Protocols {
34         [AttributeUsage (AttributeTargets.Method, Inherited = true)]
35         public sealed class SoapDocumentMethodAttribute : Attribute {
36
37                 #region Fields
38
39                 string action;
40                 string binding;
41                 bool oneWay;
42                 SoapParameterStyle parameterStyle;
43                 string requestElementName;
44                 string requestNamespace;
45                 string responseElementName;
46                 string responseNamespace;
47                 SoapBindingUse use;
48
49                 #endregion
50
51                 #region Constructors
52
53                 public SoapDocumentMethodAttribute () 
54                 {
55                 }
56
57                 public SoapDocumentMethodAttribute (string action)
58                         : this ()
59                 {
60                         this.action = action;
61                 }
62                 
63                 #endregion // Constructors
64
65                 #region Properties
66
67                 public string Action {
68                         get { return action; }
69                         set { action = value; }
70                 }
71
72                 public string Binding {
73                         get {
74                                 if (binding != null)
75                                         return binding;
76                                 return "";
77                         }
78                         set { binding = value; }
79                 }
80
81                 public bool OneWay {
82                         get { return oneWay; }
83                         set { oneWay = value; }
84                 }
85
86                 public SoapParameterStyle ParameterStyle {
87                         get { return parameterStyle; }
88                         set { parameterStyle = value; }
89                 }
90
91                 public string RequestElementName {
92                         get {
93                                 if (requestElementName == null)
94                                         return "";
95                                 return requestElementName;
96                         }
97                         set { requestElementName = value; }
98                 }
99
100                 public string RequestNamespace {
101                         get {
102                                 if (requestNamespace == null)
103                                         return "";
104                                 
105                                 return requestNamespace;
106                         }
107                         set { requestNamespace = value; }
108                 }
109
110                 public string ResponseElementName {
111                         get {
112                                 if (responseElementName == null)
113                                         return "";
114                                 return responseElementName;
115                         }
116                         set { responseElementName = value; }
117                 }
118
119                 public string ResponseNamespace {
120                         get {
121                                 if (responseNamespace == null)
122                                         return "";
123                                 return responseNamespace;
124                         }
125                         set { responseNamespace = value; }
126                 }
127
128                 public SoapBindingUse Use {
129                         get { return use; }
130                         set { use = value; }
131                 }
132
133                 #endregion // Properties
134         }
135 }