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 = new UTF8Encoding ();
56 TransferMode transfer_mode
57 = TransferMode.Buffered;
58 bool use_default_web_proxy = true;
60 public bool AllowCookies {
61 get { return allow_cookies; }
62 set { allow_cookies = value; }
65 public bool BypassProxyOnLocal {
66 get { return bypass_proxy_on_local; }
67 set { bypass_proxy_on_local = value; }
70 public HostNameComparisonMode HostNameComparisonMode {
71 get { return host_name_comparison_mode; }
72 set { host_name_comparison_mode = value; }
75 public long MaxBufferPoolSize {
76 get { return max_buffer_pool_size; }
79 throw new ArgumentOutOfRangeException ();
80 max_buffer_pool_size = value;
84 public int MaxBufferSize {
85 get { return max_buffer_size; }
88 throw new ArgumentOutOfRangeException ();
89 max_buffer_size = value;
93 public long MaxReceivedMessageSize {
94 get { return max_recv_message_size; }
97 throw new ArgumentOutOfRangeException ();
98 max_recv_message_size = value;
102 public Uri ProxyAddress {
103 get { return proxy_address; }
104 set { proxy_address = value; }
107 public XmlDictionaryReaderQuotas ReaderQuotas {
108 get { return reader_quotas; }
109 set { reader_quotas = value; }
112 public override abstract string Scheme {
116 public EnvelopeVersion EnvelopeVersion {
117 get { return env_version; }
120 public Encoding TextEncoding {
121 get { return text_encoding; }
122 set { text_encoding = value; }
125 public TransferMode TransferMode {
126 get { return transfer_mode; }
127 set { transfer_mode = value; }
130 public bool UseDefaultWebProxy {
131 get { return use_default_web_proxy; }
132 set { use_default_web_proxy = value; }
135 public override abstract BindingElementCollection CreateBindingElements ();
137 // explicit interface implementations
139 bool IBindingRuntimePreferences.ReceiveSynchronously {
140 get { return false; }