5 // Atsushi Enomoto <atsushi@ximian.com>
6 // Martin Baulig <martin.baulig@xamarin.com>
8 // Copyright (C) 2005-2006 Novell, Inc. http://www.novell.com
9 // Copyright 2011-2012 Xamarin Inc (http://www.xamarin.com).
11 // Permission is hereby granted, free of charge, to any person obtaining
12 // a copy of this software and associated documentation files (the
13 // "Software"), to deal in the Software without restriction, including
14 // without limitation the rights to use, copy, modify, merge, publish,
15 // distribute, sublicense, and/or sell copies of the Software, and to
16 // permit persons to whom the Software is furnished to do so, subject to
17 // the following conditions:
19 // The above copyright notice and this permission notice shall be
20 // included in all copies or substantial portions of the Software.
22 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
23 // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
24 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
25 // NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
26 // LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
27 // OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
31 using System.Collections.Generic;
33 using System.Net.Security;
34 using System.ServiceModel.Channels;
35 using System.ServiceModel.Description;
38 using System.ServiceModel.Configuration;
40 namespace System.ServiceModel
42 public abstract class HttpBindingBase : Binding,
43 IBindingRuntimePreferences
45 bool allow_cookies, bypass_proxy_on_local;
46 HostNameComparisonMode host_name_comparison_mode
47 = HostNameComparisonMode.StrongWildcard;
48 long max_buffer_pool_size = 0x80000;
49 int max_buffer_size = 0x10000;
50 long max_recv_message_size = 0x10000;
52 XmlDictionaryReaderQuotas reader_quotas
53 = new XmlDictionaryReaderQuotas ();
54 EnvelopeVersion env_version = EnvelopeVersion.Soap11;
55 Encoding text_encoding = default_text_encoding;
56 static readonly Encoding default_text_encoding = new UTF8Encoding ();
57 TransferMode transfer_mode
58 = TransferMode.Buffered;
59 bool use_default_web_proxy = true;
61 public bool AllowCookies {
62 get { return allow_cookies; }
63 set { allow_cookies = value; }
66 public bool BypassProxyOnLocal {
67 get { return bypass_proxy_on_local; }
68 set { bypass_proxy_on_local = value; }
71 public HostNameComparisonMode HostNameComparisonMode {
72 get { return host_name_comparison_mode; }
73 set { host_name_comparison_mode = value; }
76 public long MaxBufferPoolSize {
77 get { return max_buffer_pool_size; }
80 throw new ArgumentOutOfRangeException ();
81 max_buffer_pool_size = value;
85 public int MaxBufferSize {
86 get { return max_buffer_size; }
89 throw new ArgumentOutOfRangeException ();
90 max_buffer_size = value;
94 public long MaxReceivedMessageSize {
95 get { return max_recv_message_size; }
98 throw new ArgumentOutOfRangeException ();
99 max_recv_message_size = value;
103 public Uri ProxyAddress {
104 get { return proxy_address; }
105 set { proxy_address = value; }
108 public XmlDictionaryReaderQuotas ReaderQuotas {
109 get { return reader_quotas; }
110 set { reader_quotas = value; }
113 public override abstract string Scheme {
117 public EnvelopeVersion EnvelopeVersion {
118 get { return env_version; }
121 internal static Encoding DefaultTextEncoding {
122 get { return default_text_encoding; }
125 public Encoding TextEncoding {
126 get { return text_encoding; }
127 set { text_encoding = value; }
130 public TransferMode TransferMode {
131 get { return transfer_mode; }
132 set { transfer_mode = value; }
135 public bool UseDefaultWebProxy {
136 get { return use_default_web_proxy; }
137 set { use_default_web_proxy = value; }
140 public override abstract BindingElementCollection CreateBindingElements ();
142 // explicit interface implementations
144 bool IBindingRuntimePreferences.ReceiveSynchronously {
145 get { return false; }