SoapMessage.cs 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. //
  2. // System.Web.Services.Protocols.SoapMessage.cs
  3. //
  4. // Author:
  5. // Tim Coleman ([email protected])
  6. //
  7. // Copyright (C) Tim Coleman, 2002
  8. //
  9. // TODO:
  10. // Need to set the stream variable from the outside, or the constructor.
  11. //
  12. using System.IO;
  13. using System.Web.Services;
  14. namespace System.Web.Services.Protocols {
  15. public abstract class SoapMessage {
  16. #region Fields
  17. string content_type = "text/xml";
  18. SoapException exception = null;
  19. SoapHeaderCollection headers = new SoapHeaderCollection ();
  20. SoapMessageStage stage;
  21. Stream stream;
  22. #endregion // Fields
  23. #region Constructors
  24. internal SoapMessage ()
  25. {
  26. }
  27. #endregion
  28. #region Properties
  29. public abstract string Action {
  30. get;
  31. }
  32. public string ContentType {
  33. get { return content_type; }
  34. set { content_type = value; }
  35. }
  36. public SoapException Exception {
  37. get { return exception; }
  38. }
  39. public SoapHeaderCollection Headers {
  40. get { return headers; }
  41. }
  42. public abstract LogicalMethodInfo MethodInfo {
  43. get;
  44. }
  45. public abstract bool OneWay {
  46. get;
  47. }
  48. public SoapMessageStage Stage {
  49. get { return stage; }
  50. }
  51. internal void SetStage (SoapMessageStage stage)
  52. {
  53. this.stage = stage;
  54. }
  55. public Stream Stream {
  56. get {
  57. return stream;
  58. }
  59. }
  60. public abstract string Url {
  61. get;
  62. }
  63. #endregion Properties
  64. #region Methods
  65. protected abstract void EnsureInStage ();
  66. protected abstract void EnsureOutStage ();
  67. protected void EnsureStage (SoapMessageStage stage)
  68. {
  69. if ((((int) stage) & ((int) Stage)) == 0)
  70. throw new InvalidOperationException ("The current SoapMessageStage is not the asserted stage or stages.");
  71. }
  72. [MonoTODO]
  73. public object GetInParameterValue (int index)
  74. {
  75. throw new NotImplementedException ();
  76. }
  77. [MonoTODO]
  78. public object GetOutParameterValue (int index)
  79. {
  80. throw new NotImplementedException ();
  81. }
  82. [MonoTODO]
  83. public object GetReturnValue ()
  84. {
  85. throw new NotImplementedException ();
  86. }
  87. #endregion // Methods
  88. }
  89. }