Merge pull request #4621 from alexanderkyte/strdup_env
[mono.git] / mcs / class / System.ServiceModel.Web / System.ServiceModel / WebHttpBinding.cs
index 32d9e3606bf5cb2d38f680c8cb45833cdf258a2b..2a71219697dbf668bb63282b8f33978c65c6437a 100644 (file)
@@ -31,7 +31,7 @@ using System.Linq;
 using System.ServiceModel.Channels;
 using System.Text;
 using System.Xml;
-#if !NET_2_1
+#if !MOBILE
 using System.Configuration;
 using System.ServiceModel.Configuration;
 #endif
@@ -45,14 +45,14 @@ namespace System.ServiceModel
                {
                }
 
-               public WebHttpBinding (WebHttpSecurityMode mode)
+               public WebHttpBinding (WebHttpSecurityMode securityMode)
                {
-                       Initialize (mode);
+                       Initialize (securityMode);
                }
 
                public WebHttpBinding (string configurationName)
                {
-#if !NET_2_1
+#if !MOBILE && !XAMMAC_4_5
                        BindingsSection bindingsSection = ConfigUtil.BindingsSection;
                        WebHttpBindingElement el = (WebHttpBindingElement) bindingsSection ["webHttpBinding"].ConfiguredBindings.FirstOrDefault (c => c.Name == configurationName);
                        if (el != null) {
@@ -81,31 +81,25 @@ namespace System.ServiceModel
                WebHttpSecurity security = new WebHttpSecurity ();
                HttpTransportBindingElement t;
                // This can be changed only using <synchronousReceive> configuration element.
-               bool receive_synchronously;
                WebMessageEncodingBindingElement msgenc = new WebMessageEncodingBindingElement ();
 
                public EnvelopeVersion EnvelopeVersion {
                        get { return EnvelopeVersion.None; }
                }
 
-#if !NET_2_1
-#if NET_4_0
+#if !MOBILE && !XAMMAC_4_5
                [DefaultValue (false)]
-#endif
                public bool AllowCookies {
                        get { return t.AllowCookies; }
                        set { t.AllowCookies = value; }
                }
 
-#if NET_4_0
                [DefaultValue (false)]
-#endif
                public bool BypassProxyOnLocal {
                        get { return t.BypassProxyOnLocal; }
                        set { t.BypassProxyOnLocal = value; }
                }
 
-#if NET_4_0
                [MonoTODO]
                public bool CrossDomainScriptAccessEnabled { get; set; }
 
@@ -113,60 +107,45 @@ namespace System.ServiceModel
                        get { return msgenc.ContentTypeMapper; }
                        set { msgenc.ContentTypeMapper = value; }
                }
-#endif
 
-#if NET_4_0
                [DefaultValue (HostNameComparisonMode.StrongWildcard)]
-#endif
                public HostNameComparisonMode HostNameComparisonMode {
                        get { return t.HostNameComparisonMode; }
                        set { t.HostNameComparisonMode = value; }
                }
 
-#if NET_4_0
                [DefaultValue (0x10000)]
-#endif
                public long MaxBufferPoolSize {
                        get { return t.MaxBufferPoolSize; }
                        set { t.MaxBufferPoolSize = value; }
                }
 
-#if NET_4_0
                [DefaultValue (TransferMode.Buffered)]
-#endif
                public TransferMode TransferMode {
                        get { return t.TransferMode; }
                        set { t.TransferMode = value; }
                }
 
-#if NET_4_0
                [DefaultValue (true)]
-#endif
                public bool UseDefaultWebProxy {
                        get { return t.UseDefaultWebProxy; }
                        set { t.UseDefaultWebProxy = value; }
                }
 
-#if NET_4_0
                [DefaultValue (null)]
-#endif
                public Uri ProxyAddress {
                        get { return t.ProxyAddress; }
                        set { t.ProxyAddress = value; }
                }
 #endif
 
-#if NET_4_0
                [DefaultValue (0x80000)]
-#endif
                public int MaxBufferSize {
                        get { return t.MaxBufferSize; }
                        set { t.MaxBufferSize = value; }
                }
 
-#if NET_4_0
                [DefaultValue (0x10000)]
-#endif
                public long MaxReceivedMessageSize {
                        get { return t.MaxReceivedMessageSize; }
                        set { t.MaxReceivedMessageSize = value; }
@@ -178,18 +157,16 @@ namespace System.ServiceModel
                }
 
                public override string Scheme {
-                       get { return Security.Mode != WebHttpSecurityMode.None ? Uri.UriSchemeHttps : Uri.UriSchemeHttp; }
+                       get { return Security.Mode == WebHttpSecurityMode.Transport ? Uri.UriSchemeHttps : Uri.UriSchemeHttp; }
                }
 
                public WebHttpSecurity Security {
                        get { return security; }
-#if NET_4_0
                        set {
                                if (value == null)
                                        throw new ArgumentNullException ("value");
                                security = value;
                        }
-#endif
                }
 
                public Encoding WriteEncoding {
@@ -207,10 +184,9 @@ namespace System.ServiceModel
                }
 
                bool IBindingRuntimePreferences.ReceiveSynchronously {
-                       get { return receive_synchronously; }
+                       get { return false; }
                }
 
-#if NET_4_0
                [EditorBrowsable (EditorBrowsableState.Advanced)]
                public bool ShouldSerializeReaderQuotas ()
                {
@@ -228,6 +204,5 @@ namespace System.ServiceModel
                {
                        return false;
                }
-#endif
        }
 }