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