[LoongArch64] Part-5:add loongarch support in some files for LoongArch64. (#21769)
[mono-project.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / SoapHeader.cs
blobcbca02f6404d0e66ad0500f6aba591825fc92e22
1 //
2 // System.Web.Services.Protocols.SoapHeader.cs
3 //
4 // Author:
5 // Tim Coleman (tim@timcoleman.com)
6 //
7 // Copyright (C) Tim Coleman, 2002
8 //
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.
31 using System.ComponentModel;
32 using System.Xml.Serialization;
33 using System.Xml;
35 namespace System.Web.Services.Protocols {
36 [SoapType (IncludeInSchema = false)]
37 [XmlType (IncludeInSchema = false)]
38 public abstract class SoapHeader {
40 #region Fields
42 string actor;
43 bool didUnderstand;
44 bool mustUnderstand;
46 string role;
47 bool relay;
49 #endregion // Fields
51 #region Constructors
53 protected SoapHeader ()
55 actor = String.Empty;
56 didUnderstand = false;
57 mustUnderstand = false;
60 internal SoapHeader (XmlElement elem)
62 actor = elem.GetAttribute ("actor", WebServiceHelper.SoapEnvelopeNamespace);
63 string me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.SoapEnvelopeNamespace);
64 if (me != "") EncodedMustUnderstand = me;
65 role = elem.GetAttribute ("role", WebServiceHelper.Soap12EnvelopeNamespace);
66 me = elem.GetAttribute ("mustUnderstand", WebServiceHelper.Soap12EnvelopeNamespace);
67 if (me != "") EncodedMustUnderstand12 = me;
70 #endregion // Constructors
72 #region Properties
74 [DefaultValue ("")]
75 [SoapAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
76 [XmlAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
77 public string Actor {
78 get { return actor; }
79 set { actor = value; }
82 [SoapIgnore]
83 [XmlIgnore]
84 public bool DidUnderstand {
85 get { return didUnderstand; }
86 set { didUnderstand = value; }
89 [DefaultValue ("0")]
90 [SoapAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
91 [XmlAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
92 public string EncodedMustUnderstand {
93 get { return (MustUnderstand ? "1" : "0"); }
94 set {
95 if (value == "true" || value == "1")
96 MustUnderstand = true;
97 else if (value == "false" || value == "0")
98 MustUnderstand = false;
99 else
100 throw new ArgumentException ();
104 [SoapIgnore]
105 [XmlIgnore]
106 public bool MustUnderstand {
107 get { return mustUnderstand; }
108 set { mustUnderstand = value; }
112 [DefaultValue ("0")]
113 [SoapAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
114 [XmlAttribute ("mustUnderstand", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
115 [System.Runtime.InteropServices.ComVisible(false)]
116 public string EncodedMustUnderstand12 {
117 get { return (MustUnderstand ? "1" : "0"); }
118 set {
119 if (value == "true" || value == "1")
120 MustUnderstand = true;
121 else if (value == "false" || value == "0")
122 MustUnderstand = false;
123 else
124 throw new ArgumentException ();
128 [DefaultValue ("0")]
129 [SoapAttribute ("relay", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
130 [XmlAttribute ("relay", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
131 [System.Runtime.InteropServices.ComVisible(false)]
132 public string EncodedRelay
134 get { return (Relay ? "1" : "0"); }
135 set {
136 if (value == "true" || value == "1")
137 Relay = true;
138 else if (value == "false" || value == "0")
139 Relay = false;
140 else
141 throw new ArgumentException ();
145 [SoapIgnore]
146 [XmlIgnore]
147 [System.Runtime.InteropServices.ComVisible(false)]
148 public bool Relay {
149 get { return relay; }
150 set { relay = value; }
153 [DefaultValue ("")]
154 [SoapAttribute ("role", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
155 [XmlAttribute ("role", Namespace = "http://www.w3.org/2003/05/soap-envelope")]
156 [System.Runtime.InteropServices.ComVisible(false)]
157 public string Role {
158 get { return role; }
159 set { role = value; }
163 #endregion // Properties