* Methods.cs: removed handler for UnknownNode event
[mono.git] / mcs / class / System.Web.Services / System.Web.Services.Protocols / SoapMessage.cs
index b0d90440dd0fbd04c0218ddbb9dc79530214b989..51e160068eee3eb16538349f62c1c457be50b3d0 100644 (file)
@@ -6,6 +6,9 @@
 //\r
 // Copyright (C) Tim Coleman, 2002\r
 //\r
+// TODO:\r
+//    Need to set the stream variable from the outside, or the constructor.\r
+//\r
 \r
 using System.IO;\r
 using System.Web.Services;\r
@@ -15,13 +18,22 @@ namespace System.Web.Services.Protocols {
 \r
                #region Fields\r
 \r
-               string contentType = "text/xml";\r
+               string content_type = "text/xml";\r
                SoapException exception = null;\r
                SoapHeaderCollection headers = null;\r
                SoapMessageStage stage;\r
-\r
+               Stream stream;\r
+               \r
                #endregion // Fields\r
 \r
+               #region Constructors\r
+\r
+               internal SoapMessage ()\r
+               {\r
+               }\r
+\r
+               #endregion\r
+\r
                #region Properties\r
 \r
                public abstract string Action {\r
@@ -29,8 +41,8 @@ namespace System.Web.Services.Protocols {
                }\r
 \r
                public string ContentType {\r
-                       get { return contentType; }\r
-                       set { contentType = value; }\r
+                       get { return content_type; }\r
+                       set { content_type = value; }\r
                }\r
 \r
                public SoapException Exception {\r
@@ -53,9 +65,15 @@ namespace System.Web.Services.Protocols {
                        get { return stage; }\r
                }\r
 \r
+               internal void SetStage (SoapMessageStage stage)\r
+               {\r
+                       this.stage = stage;\r
+               }\r
+               \r
                public Stream Stream {\r
-                       [MonoTODO]\r
-                       get { throw new NotImplementedException (); }\r
+                       get {\r
+                               return stream;\r
+                       }\r
                }\r
 \r
                public abstract string Url {\r
@@ -69,10 +87,10 @@ namespace System.Web.Services.Protocols {
                protected abstract void EnsureInStage ();\r
                protected abstract void EnsureOutStage ();\r
 \r
-               [MonoTODO]\r
                protected void EnsureStage (SoapMessageStage stage) \r
                {\r
-                       throw new NotImplementedException ();\r
+                       if ((((int) stage) & ((int) Stage)) == 0)\r
+                               throw new InvalidOperationException ("The current SoapMessageStage is not the asserted stage or stages.");\r
                }\r
 \r
                [MonoTODO]\r