| | | 1 | | // Licensed to the .NET Foundation under one or more agreements. |
| | | 2 | | // The .NET Foundation licenses this file to you under the MIT license. |
| | | 3 | | |
| | | 4 | | using System.Configuration; |
| | | 5 | | using CoreWCF.Channels; |
| | | 6 | | |
| | | 7 | | namespace CoreWCF.Configuration |
| | | 8 | | { |
| | | 9 | | public class WSHttpBindingElement : WSHttpBindingBaseElement |
| | | 10 | | { |
| | | 11 | | public WSHttpBindingElement(string name) |
| | 3 | 12 | | : base(name) |
| | | 13 | | { |
| | 3 | 14 | | } |
| | | 15 | | |
| | | 16 | | public WSHttpBindingElement() |
| | 3 | 17 | | : this(null) |
| | | 18 | | { |
| | 3 | 19 | | } |
| | | 20 | | |
| | | 21 | | [ConfigurationProperty(ConfigurationStrings.AllowCookies, DefaultValue = false)] |
| | | 22 | | public bool AllowCookies |
| | | 23 | | { |
| | 0 | 24 | | get { return (bool)base[ConfigurationStrings.AllowCookies]; } |
| | 0 | 25 | | set { base[ConfigurationStrings.AllowCookies] = value; } |
| | | 26 | | |
| | | 27 | | } |
| | | 28 | | |
| | | 29 | | [ConfigurationProperty(ConfigurationStrings.Security)] |
| | | 30 | | public WSHttpSecurityElement Security |
| | | 31 | | { |
| | 5 | 32 | | get { return (WSHttpSecurityElement)base[ConfigurationStrings.Security]; } |
| | | 33 | | } |
| | | 34 | | |
| | | 35 | | public override Binding CreateBinding() |
| | | 36 | | { |
| | 2 | 37 | | var binding = new WSHttpBinding(Security.Mode) |
| | 2 | 38 | | { |
| | 2 | 39 | | CloseTimeout = CloseTimeout, |
| | 2 | 40 | | MaxBufferPoolSize = MaxBufferPoolSize, |
| | 2 | 41 | | MaxReceivedMessageSize = MaxReceivedMessageSize, |
| | 2 | 42 | | Name = Name, |
| | 2 | 43 | | OpenTimeout = OpenTimeout, |
| | 2 | 44 | | ReaderQuotas = ReaderQuotas.Clone(), |
| | 2 | 45 | | ReceiveTimeout = ReceiveTimeout, |
| | 2 | 46 | | SendTimeout = SendTimeout, |
| | 2 | 47 | | }; |
| | | 48 | | |
| | | 49 | | //binding.AllowCookies = this.AllowCookies; |
| | 2 | 50 | | Security.ApplyConfiguration(binding.Security); |
| | 2 | 51 | | return binding; |
| | | 52 | | } |
| | | 53 | | } |
| | | 54 | | } |