瀏覽代碼

2006-12-18 Atsushi Enomoto <[email protected]>

	* WebServiceHandlerFactory.cs,
	  SoapServerMessage.cs,
	  HttpSoapWebServiceHandler.cs :
	  set guessed protocol to SoapServerMessage.


svn path=/branches/atsushi/mcs/; revision=69653
Atsushi Eno 19 年之前
父節點
當前提交
dcd6c9af5a

+ 7 - 0
mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog

@@ -1,3 +1,10 @@
+2006-12-18  Atsushi Enomoto  <[email protected]>
+
+	* WebServiceHandlerFactory.cs,
+	  SoapServerMessage.cs,
+	  HttpSoapWebServiceHandler.cs :
+	  set guessed protocol to SoapServerMessage.
+
 2006-12-18  Atsushi Enomoto  <[email protected]>
 
 	* TypeStubManager.cs, Methods.cs, SoapServerMethod.cs :

+ 12 - 1
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSoapWebServiceHandler.cs

@@ -80,8 +80,14 @@ namespace System.Web.Services.Protocols
 
 			try
 			{
-				if (requestMessage == null)
+				if (requestMessage == null) {
 					requestMessage = DeserializeRequest (context.Request);
+#if NET_2_0
+					object soapVer = context.Items ["WebServiceSoapVersion"];
+					if (soapVer != null)
+						requestMessage.SetSoapVersion ((SoapProtocolVersion) soapVer);
+#endif
+				}
 				
 				if (methodInfo != null && methodInfo.OneWay) {
 					context.Response.BufferOutput = false;
@@ -354,6 +360,11 @@ namespace System.Web.Services.Protocols
 				faultMessage = new SoapServerMessage (context.Request, soex, requestMessage.MethodStubInfo, requestMessage.Server, requestMessage.Stream);
 			else
 				faultMessage = new SoapServerMessage (context.Request, soex, null, null, null);
+#if NET_2_0
+			object soapVer = context.Items ["WebServiceSoapVersion"];
+			if (soapVer != null)
+				faultMessage.SetSoapVersion ((SoapProtocolVersion) soapVer);
+#endif
 
 			SerializeResponse (context.Response, faultMessage);
 			context.Response.End ();

+ 11 - 1
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapServerMessage.cs

@@ -42,6 +42,9 @@ namespace System.Web.Services.Protocols {
 		object server;
 		string url;
 		object[] parameters;
+#if NET_2_0
+		SoapProtocolVersion soapVersion;
+#endif
 
 		#endregion
 
@@ -103,7 +106,7 @@ namespace System.Web.Services.Protocols {
 		[MonoTODO]
 		[System.Runtime.InteropServices.ComVisible(false)]
 		public override SoapProtocolVersion SoapVersion {
-			get { throw new NotImplementedException (); }
+			get { return soapVersion; }
 		}
 #endif
 
@@ -121,6 +124,13 @@ namespace System.Web.Services.Protocols {
 			EnsureStage (SoapMessageStage.BeforeSerialize);
 		}
 
+#if NET_2_0
+		internal void SetSoapVersion (SoapProtocolVersion value)
+		{
+			soapVersion = value;
+		}
+#endif
+
 		#endregion // Methods
 	}
 }

+ 6 - 0
mcs/class/System.Web.Services/System.Web.Services.Protocols/WebServiceHandlerFactory.cs

@@ -101,6 +101,12 @@ namespace System.Web.Services.Protocols
 			Type type = WebServiceParser.GetCompiledType (filePath, context);
 
 			WSProtocol protocol = GuessProtocol (context, verb);
+#if NET_2_0
+			context.Items ["WebServiceSoapVersion"] =
+				protocol == WSProtocol.HttpSoap12 ?
+				SoapProtocolVersion.Soap12 :
+				SoapProtocolVersion.Default;
+#endif
 			bool supported = false;
 			IHttpHandler handler = null;