SoapHeader.cs 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. //
  2. // System.Web.Services.Protocols.SoapHeader.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. using System.ComponentModel;
  10. using System.Xml.Serialization;
  11. namespace System.Web.Services.Protocols {
  12. [SoapType (IncludeInSchema = false)]
  13. [XmlType (IncludeInSchema = false)]
  14. public abstract class SoapHeader {
  15. #region Fields
  16. string actor;
  17. bool didUnderstand;
  18. bool mustUnderstand;
  19. #endregion // Fields
  20. #region Constructors
  21. protected SoapHeader ()
  22. {
  23. actor = String.Empty;
  24. didUnderstand = false;
  25. mustUnderstand = false;
  26. }
  27. #endregion // Constructors
  28. #region Properties
  29. [DefaultValue ("")]
  30. [SoapAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
  31. [XmlAttribute ("actor", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
  32. public string Actor {
  33. get { return actor; }
  34. set { actor = value; }
  35. }
  36. [SoapIgnore]
  37. [XmlIgnore]
  38. public bool DidUnderstand {
  39. get { return didUnderstand; }
  40. set { didUnderstand = value; }
  41. }
  42. [DefaultValue ("0")]
  43. [SoapAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
  44. [XmlAttribute ("mustUnderstand", Namespace = "http://schemas.xmlsoap.org/soap/envelope/")]
  45. public string EncodedMustUnderstand {
  46. get { return (MustUnderstand ? "1" : "0"); }
  47. set {
  48. if (value == "true" || value == "1")
  49. MustUnderstand = true;
  50. else if (value == "false" || value == "0")
  51. MustUnderstand = false;
  52. else
  53. throw new ArgumentException ();
  54. }
  55. }
  56. [SoapIgnore]
  57. [XmlIgnore]
  58. public bool MustUnderstand {
  59. get { return mustUnderstand; }
  60. set { mustUnderstand = value; }
  61. }
  62. #endregion // Properties
  63. }
  64. }