HttpHostConfiguration.BuildAdvanced()

Topics: Web Api
Sep 19, 2011 at 4:07 PM

In the preview 4 experimental branch i used the following to set the binding but don't see this in preview 5, is there another way to acomplish this?

 

var config = HttpHostConfiguration.BuildAdvanced().ConfigureEndpoint(x => x.Binding = binding);

Thanks Joe

Coordinator
Sep 19, 2011 at 5:04 PM

You can configure endpoints by deriving from HttpConfiguration and overriding OnConfigureEndpoint(…).

Can you tell me though why you want to change the binding? There might be an easier way to accomplish what you want to do by using HttpConfiguration directly.

Daniel Roth

From: josephanzalone [email removed]
Sent: Monday, September 19, 2011 9:08 AM
To: Daniel Roth
Subject: HttpHostConfiguration.BuildAdvanced() [wcf:273088]

From: josephanzalone

In the preview 4 experimental branch i used the following to set the binding but don't see this in preview 5, is there another way to acomplish this?

var config = HttpHostConfiguration.BuildAdvanced().ConfigureEndpoint(x => x.Binding = binding);

Thanks Joe

Sep 19, 2011 at 5:26 PM

Thanks Daniel for getting back so fast, the reason that i need to change the binding is because of some legacy services that have set the following properties. 

 

var binding = new HttpBinding ();

binding.CloseTimeout = new TimeSpan (0, 10, 0);

binding.OpenTimeout = new TimeSpan 

(0, 10, 0);  

binding.SendTimeout = new TimeSpan

(0, 10, 0);

binding.MaxReceivedMessageSize = 2147483647;

binding.MaxBufferPoolSize = 2147483647;

 

Thanks Joe

Coordinator
Sep 19, 2011 at 6:10 PM

Makes sense – you can set MaxReceivedMessageSize on the HttpConfiguration instance, but the timeouts are not currently exposed, so configuring the binding directly is your only option currently.

Daniel Roth

From: josephanzalone [email removed]
Sent: Monday, September 19, 2011 10:27 AM
To: Daniel Roth
Subject: Re: HttpHostConfiguration.BuildAdvanced() [wcf:273088]

From: josephanzalone

Thanks Daniel for getting back so fast, the reason that i need to change the binding is because of some legacy services that have set the following properties.

var binding = new HttpBinding ();

binding.CloseTimeout = new TimeSpan (0, 10, 0);

binding.OpenTimeout = new TimeSpan

(0, 10, 0);

binding.SendTimeout = new TimeSpan

(0, 10, 0);

binding.MaxReceivedMessageSize = 2147483647;

binding.MaxBufferPoolSize = 2147483647;

Thanks Joe