How to fix: "Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding" Errors

by jmorris 24. June 2010 14:30

After deploying a project from development environment running off of the VS development Web server Cassini to a production box using IIS, I noticed that all of my WCF service were all failing with the same HTTP 500 error:

The problem is that IIS needs to determine which base address in the bindings to host the service. However, WCF services only allows one service hosted under a site to be bound to one base address for a scheme. In situations where you have multiple services being hosted under a single site, the binding must specify a base address to use filter requests to t he specific service.

To resolve the issue, simple provide the base address in the baseAddressPrefixFilters section of the web.config:

By adding the prefix above, only requests with the specified base address above will be passed through. All others will be blocked and a HTTP 500 error returned to the client:

"System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are []"

Tags: , , , ,

WCF

Jeff Morris

Widget Tag cloud not found.

Unable to cast object of type 'ASP.widgets_tag_cloud_widget_ascx' to type 'App_Code.Controls.WidgetBase'.X

Widget Month List not found.

Unable to cast object of type 'ASP.widgets_month_list_widget_ascx' to type 'App_Code.Controls.WidgetBase'.X

Widget Page List not found.

Unable to cast object of type 'ASP.widgets_page_list_widget_ascx' to type 'App_Code.Controls.WidgetBase'.X

Widget Blogroll not found.

Unable to cast object of type 'ASP.widgets_blogroll_widget_ascx' to type 'App_Code.Controls.WidgetBase'.X

Widget Visitor info not found.

Unable to cast object of type 'ASP.widgets_visitor_info_widget_ascx' to type 'App_Code.Controls.WidgetBase'.X

Widget Visitor info not found.

Unable to cast object of type 'ASP.widgets_visitor_info_widget_ascx' to type 'App_Code.Controls.WidgetBase'.X