Server Error in MultipleBindings Application
This collection already contains an address with scheme http. There can be at most one address per scheme in this collection.
With a correctly configured web.config
it's good possible to host the service on two URL's, for example https://payment.example.com:443 and https://payment.example.com:9000.
Fixes for "WCF Server Error in MultipleBindings Application" in differnet .NET Framework versions
Different .NET Framework versions have different solutions for this error.
Fix for .NET 2.0/3.0/3.5
- Set a baseAddressPrefix on one of the two URL's in the web.config file:
<system.serviceModel>
<servicehostingenvironment>
<baseaddressprefixfilters>
<add prefix="https://payment.example.com:443"/>
</baseaddressprefixfilters>
</servicehostingenvironment>
</system.serviceModel>
- Add both endpoint URL's as absolute URL's in the web.config file:
<services>
<service>
<endpoint
address="https://payment.example.com:443/Service1.svc/EP1"
Binding="..."
Contract="..." />
<endpoint address="https://payment.example.com:9000/Service1.svc/EP12"
Binding="..."
Contract="..." />
</service>
</services>
Fix for ASP.NET 4.0/4.5
ASP.NET 4.0/4.5 has a multipleSiteBindingsEnabled web.config configuration optie available to services multiple site bindings. Keep this in mind when you port your 3.0/3.5 application to 4.0.
<servicehostingenvironment multipleSiteBindingsEnabled="true" />
For ASP.NET 4.0/4.5 you first must install NET-HTTP-Activation and NET-WCF-HTTP-Activation features in IIS. Verify the *.svc
handler is added to IIS after installation.
References and more information:
- http://blogs.msdn.com/b/rampo/archive/2008/02/11/how-can-wcf-support-multiple-iis-binding-specified-per-site.aspx (Wayback Machine mirror)
- Supporting Multiple IIS Site Bindings