Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WCF Config element: baseAddressPrefixFilters

I have read the documentation for this element but still fail to understand what its purpose is. Here is a sample of how I've seen it used in examples:

<serviceHostingEnvironment>
  <baseAddressPrefixFilters>
    <add prefix="http://localhost:5100/"/>
  </baseAddressPrefixFilters>
</serviceHostingEnvironment>

I want to understand what this does that the base addresses in a service node doesn't do. I don't understand what this element is actually used for.

like image 859
DarkwingDuck Avatar asked Feb 03 '09 10:02

DarkwingDuck


1 Answers

A WCF service host will only allow a single base address per scheme (HTTP in this case). Now if you deploy a WCF service on an IIS configured with multiple base addresses, for example http://www.example.com and http://example.com you will see an error. Using the baseAddressPrefixFilters you can filter one of the two base addresses and your service will run just fine.

like image 155
Maurice Avatar answered Sep 17 '22 23:09

Maurice