2006-12-15 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Fri, 15 Dec 2006 04:54:38 +0000 (04:54 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 15 Dec 2006 04:54:38 +0000 (04:54 -0000)
* SoapProtocolImporter.cs : since Soap12Binding is derived from
  SoapBinding, extra care in IsBindingSupported() is needed.

* HttpSoapWebServiceHandler.cs,
  SoapHttpClientProtocol.cs : support application/soap+xml.

svn path=/branches/atsushi/mcs/; revision=69521

mcs/class/System.Web.Services/System.Web.Services.Description/ChangeLog
mcs/class/System.Web.Services/System.Web.Services.Description/SoapProtocolImporter.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/ChangeLog
mcs/class/System.Web.Services/System.Web.Services.Protocols/HttpSoapWebServiceHandler.cs
mcs/class/System.Web.Services/System.Web.Services.Protocols/SoapHttpClientProtocol.cs

index f3f3c3b5db2f60a731460a7857217271a0d3a88a..f88f06ec59425559f5d42737270741145c66e8b5 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-15  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * SoapProtocolImporter.cs : since Soap12Binding is derived from
+         SoapBinding, extra care in IsBindingSupported() is needed.
+
 2006-12-14  Atsushi Enomoto  <atsushi@ximian.com>
 
        * SoapProtocolImporter.cs : if the importer is SOAP12, initialize
index 937e3ef153fa4c496e885815b2277d04256798c3..9280c909411fe5720437a8ff3c67cd8129d93b5b 100644 (file)
@@ -192,7 +192,12 @@ namespace System.Web.Services.Description {
 
                protected override bool IsBindingSupported ()
                {
+#if NET_2_0
+                       object o = Binding.Extensions.Find (typeof(SoapBinding));
+                       return o != null && !(o is Soap12Binding);
+#else
                        return Binding.Extensions.Find (typeof(SoapBinding)) != null;
+#endif
                }
 
                [MonoTODO]
@@ -656,6 +661,11 @@ namespace System.Web.Services.Description {
                public override string ProtocolName {
                        get { return "Soap12"; }
                }
+
+               protected override bool IsBindingSupported ()
+               {
+                       return Binding.Extensions.Find (typeof(Soap12Binding)) != null;
+               }
        }
 #endif
 }
index 542240d0e4bfdce36f8f94ed98788c2de1be9abf..1fc9721394bf72ca16c504a810db15b2c0b6a5f9 100644 (file)
@@ -1,3 +1,8 @@
+2006-12-15  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * HttpSoapWebServiceHandler.cs,
+         SoapHttpClientProtocol.cs : support application/soap+xml.
+
 2006-12-04  Atsushi Enomoto  <atsushi@ximian.com>
 
        * AnyReturnReader.cs : not sure why, but the build must have been
index 3f5adc054aff73cffa3a5483e216c7039419969e..0f9670f6e8dad4f0d1f04c395063d8cae80008f2 100644 (file)
@@ -121,7 +121,11 @@ namespace System.Web.Services.Protocols
                                string soapAction = null;
                                string ctype;
                                Encoding encoding = WebServiceHelper.GetContentEncoding (request.ContentType, out ctype);
+#if NET_2_0
+                               if (ctype != "text/xml" && ctype != "application/soap+xml")
+#else
                                if (ctype != "text/xml")
+#endif
                                        throw new WebException ("Content is not XML: " + ctype);
                                        
                                object server = CreateServerInstance ();
index 654cc4b67296095d653daa82c7dc4aad7450747c..6630a1f36179fc1506ea9d339afab32717dbfe3a 100644 (file)
@@ -284,9 +284,15 @@ namespace System.Web.Services.Protocols
                        //
                        string ctype;
                        Encoding encoding = WebServiceHelper.GetContentEncoding (response.ContentType, out ctype);
-                       if (ctype != "text/xml")
+                       string expectedCType =
+#if NET_2_0
+                               (message.SoapVersion == SoapProtocolVersion.Soap12 ? "application/soap+xml" : "text/xml");
+#else
+                               "text/xml";
+#endif
+                       if (ctype != expectedCType)
                                WebServiceHelper.InvalidOperation (
-                                       "Content is not 'text/xml' but '" + response.ContentType + "'",
+                                       String.Format ("Content is not '{0}' but '{1}'", expectedCType, response.ContentType),
                                        response, encoding);
 
                        message.ContentType = ctype;