2 // System.Web.Services.Protocols.SoapHeader.cs
5 // Tim Coleman (tim@timcoleman.com)
7 // Copyright (C) Tim Coleman, 2002
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:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
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
;
35 namespace System
.Web
.Services
.Protocols
{
36 [SoapType (IncludeInSchema
= false)]
37 [XmlType (IncludeInSchema
= false)]
38 public abstract class SoapHeader
{
55 protected SoapHeader ()
58 didUnderstand
= false;
59 mustUnderstand
= false;
62 internal SoapHeader (XmlElement elem
)
64 actor
= elem
.GetAttribute ("actor", "http://schemas.xmlsoap.org/soap/envelope/");
65 string me
= elem
.GetAttribute ("mustUnderstand", "http://schemas.xmlsoap.org/soap/envelope/");
66 if (me
!= "") EncodedMustUnderstand
= me
;
69 #endregion // Constructors
74 [SoapAttribute ("actor", Namespace
= "http://schemas.xmlsoap.org/soap/envelope/")]
75 [XmlAttribute ("actor", Namespace
= "http://schemas.xmlsoap.org/soap/envelope/")]
78 set { actor = value; }
83 public bool DidUnderstand
{
84 get { return didUnderstand; }
85 set { didUnderstand = value; }
89 [SoapAttribute ("mustUnderstand", Namespace
= "http://schemas.xmlsoap.org/soap/envelope/")]
90 [XmlAttribute ("mustUnderstand", Namespace
= "http://schemas.xmlsoap.org/soap/envelope/")]
91 public string EncodedMustUnderstand
{
92 get { return (MustUnderstand ? "1" : "0"); }
94 if (value == "true" || value == "1")
95 MustUnderstand
= true;
96 else if (value == "false" || value == "0")
97 MustUnderstand
= false;
99 throw new ArgumentException ();
105 public bool MustUnderstand
{
106 get { return mustUnderstand; }
107 set { mustUnderstand = value; }
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"); }
119 if (value == "true" || value == "1")
120 MustUnderstand
= true;
121 else if (value == "false" || value == "0")
122 MustUnderstand
= false;
124 throw new ArgumentException ();
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"); }
136 if (value == "true" || value == "1")
138 else if (value == "false" || value == "0")
141 throw new ArgumentException ();
147 [System
.Runtime
.InteropServices
.ComVisible(false)]
149 get { return relay; }
150 set { relay = value; }
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)]
159 set { role = value; }
164 #endregion // Properties