Author: atsushi
Date: 2008-02-14 11:55:52 -0500 (Thu, 14 Feb 2008)
New Revision: 95646

Modified:
   trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/ChangeLog
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpBinding.cs
   
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpSecurity.cs
   trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/ChangeLog
   
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/WebHttpBindingTest.cs
Log:
2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>

        * WebHttpBinding.cs : implemented every remaining member but
          configuration support.
        * WebHttpSecurity.cs : implement Transport.

        * WebHttpBindingTest.cs : test ReceiveSynchronously.



Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/ChangeLog
===================================================================
--- trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/ChangeLog     
2008-02-14 16:09:30 UTC (rev 95645)
+++ trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/ChangeLog     
2008-02-14 16:55:52 UTC (rev 95646)
@@ -1,3 +1,9 @@
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * WebHttpBinding.cs : implemented every remaining member but
+         configuration support.
+       * WebHttpSecurity.cs : implement Transport.
+
 2008-02-12  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * WebHttpBinding.cs : use ManualAddressing.

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpBinding.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpBinding.cs 
    2008-02-14 16:09:30 UTC (rev 95645)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpBinding.cs 
    2008-02-14 16:55:52 UTC (rev 95646)
@@ -32,31 +32,36 @@
 
 namespace System.ServiceModel
 {
-       [MonoTODO]
        public class WebHttpBinding : Binding, IBindingRuntimePreferences
        {
-               [MonoTODO]
                public WebHttpBinding ()
+                       : this (WebHttpSecurityMode.None)
                {
                }
 
-               [MonoTODO]
                public WebHttpBinding (WebHttpSecurityMode mode)
                {
                        security.Mode = mode;
+                       // MSDN says that this security mode can be set only
+                       // at .ctor(), so there is no problem on depending on
+                       // this value here.
+                       t = mode == WebHttpSecurityMode.Transport ? new 
HttpsTransportBindingElement () : new HttpTransportBindingElement ();
+                       t.ManualAddressing = true;
                }
 
                [MonoTODO]
                public WebHttpBinding (string configurationName)
                {
+                       throw new NotImplementedException ();
                }
 
                XmlDictionaryReaderQuotas quotas;
                WebHttpSecurity security = new WebHttpSecurity ();
                Encoding write_encoding = Encoding.UTF8;
+               HttpTransportBindingElement t;
+               // This can be changed only using <synchronousReceive> 
configuration element.
+               bool receive_synchronously;
 
-               HttpTransportBindingElement t = new HttpTransportBindingElement 
() { ManualAddressing = true };
-
                public bool AllowCookies {
                        get { return t.AllowCookies; }
                        set { t.AllowCookies = value; }
@@ -105,7 +110,6 @@
                        get { return Security.Mode != WebHttpSecurityMode.None 
? Uri.UriSchemeHttps : Uri.UriSchemeHttp; }
                }
 
-               [MonoTODO]
                public WebHttpSecurity Security {
                        get { return security; }
                }
@@ -129,11 +133,8 @@
                        }
                }
 
-               [MonoTODO]
                public override BindingElementCollection CreateBindingElements 
()
                {
-                       // FIXME: apply Security
-
                        WebMessageEncodingBindingElement m = new 
WebMessageEncodingBindingElement (WriteEncoding);
                        if (ReaderQuotas != null)
                                ReaderQuotas.CopyTo (m.ReaderQuotas);
@@ -141,9 +142,8 @@
                        return new BindingElementCollection (m, t.Clone ());
                }
 
-               [MonoTODO]
                bool IBindingRuntimePreferences.ReceiveSynchronously {
-                       get { throw new NotImplementedException (); }
+                       get { return receive_synchronously; }
                }
        }
 }

Modified: 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpSecurity.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpSecurity.cs
    2008-02-14 16:09:30 UTC (rev 95645)
+++ 
trunk/olive/class/System.ServiceModel.Web/System.ServiceModel/WebHttpSecurity.cs
    2008-02-14 16:55:52 UTC (rev 95646)
@@ -34,15 +34,16 @@
                }
 
                WebHttpSecurityMode mode;
+               // there is no publicly exposed constructor for transport ...
+               HttpTransportSecurity transport = new BasicHttpBinding 
().Security.Transport;
 
                public WebHttpSecurityMode Mode {
                        get { return mode; }
                        set { mode = value; }
                }
 
-               [MonoTODO] // how can I instantiate it?
                public HttpTransportSecurity Transport {
-                       get { throw new NotImplementedException (); }
+                       get { return transport; }
                }
        }
 }

Modified: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/ChangeLog
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/ChangeLog    
    2008-02-14 16:09:30 UTC (rev 95645)
+++ 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/ChangeLog    
    2008-02-14 16:55:52 UTC (rev 95646)
@@ -1,3 +1,7 @@
+2008-02-14  Atsushi Enomoto  <[EMAIL PROTECTED]>
+
+       * WebHttpBindingTest.cs : test ReceiveSynchronously.
+
 2008-02-05  Atsushi Enomoto  <[EMAIL PROTECTED]>
 
        * WebHttpBindingTest.cs : new test file.

Modified: 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/WebHttpBindingTest.cs
===================================================================
--- 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/WebHttpBindingTest.cs
    2008-02-14 16:09:30 UTC (rev 95645)
+++ 
trunk/olive/class/System.ServiceModel.Web/Test/System.ServiceModel/WebHttpBindingTest.cs
    2008-02-14 16:55:52 UTC (rev 95646)
@@ -18,6 +18,7 @@
                        Assert.AreEqual (0x10000, b.MaxBufferSize, "#3");
                        Assert.AreEqual (0x80000, b.MaxBufferPoolSize, "#4");
                        Assert.AreEqual (0x10000, b.MaxReceivedMessageSize, 
"#5");
+                       Assert.IsFalse (((IBindingRuntimePreferences) 
b).ReceiveSynchronously, "#6");
                }
 
                [Test]

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to