| | | 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 BasicHttpBindingElement : HttpBindingBaseElement |
| | | 10 | | { |
| | | 11 | | public BasicHttpBindingElement(string name) |
| | 5 | 12 | | : base(name) |
| | | 13 | | { |
| | 5 | 14 | | } |
| | | 15 | | |
| | | 16 | | public BasicHttpBindingElement() |
| | 5 | 17 | | : this(null) |
| | | 18 | | { |
| | 5 | 19 | | } |
| | | 20 | | |
| | | 21 | | [ConfigurationProperty(ConfigurationStrings.Security)] |
| | | 22 | | public BasicHttpSecurityElement Security |
| | | 23 | | { |
| | 9 | 24 | | get { return (BasicHttpSecurityElement)base[ConfigurationStrings.Security]; } |
| | | 25 | | } |
| | | 26 | | |
| | | 27 | | public override Binding CreateBinding() |
| | | 28 | | { |
| | 4 | 29 | | var binding = new BasicHttpBinding(Security.Mode) |
| | 4 | 30 | | { |
| | 4 | 31 | | Name = Name, |
| | 4 | 32 | | MaxReceivedMessageSize = MaxReceivedMessageSize, |
| | 4 | 33 | | MaxBufferSize = MaxBufferSize, |
| | 4 | 34 | | ReceiveTimeout = ReceiveTimeout, |
| | 4 | 35 | | CloseTimeout = CloseTimeout, |
| | 4 | 36 | | OpenTimeout = OpenTimeout, |
| | 4 | 37 | | SendTimeout = SendTimeout, |
| | 4 | 38 | | TransferMode = TransferMode, |
| | 4 | 39 | | TextEncoding = TextEncoding, |
| | 4 | 40 | | ReaderQuotas = ReaderQuotas.Clone(), |
| | 4 | 41 | | }; |
| | | 42 | | |
| | 4 | 43 | | Security.ApplyConfiguration(binding.Security); |
| | 4 | 44 | | return binding; |
| | | 45 | | } |
| | | 46 | | } |
| | | 47 | | } |