title: How to fix "could not find a base address that matches schema http"... in WCF
body: <p>I'm trying to deploy a WCF service to my server, hosted in IIS. Naturally it works on my machine :)</p>
  
  <p>But when I deploy it, I get the following error: </p>
  
  <blockquote>
    <p>This collection already contains an
    address with scheme http.  There can
    be at most one address per scheme in
    this collection.</p>
  </blockquote>
  
  <p>Googling on this, I find that I have to put a serviceHostingEnvironment element into the web.config file:</p>
  
  <pre><code>&lt;serviceHostingEnvironment&gt;
    &lt;baseAddressPrefixFilters&gt;
      &lt;add prefix="http://mywebsiteurl"/&gt;
    &lt;/baseAddressPrefixFilters&gt;
  &lt;/serviceHostingEnvironment&gt;
  </code></pre>
  
  <p>But once I have done this, I get the following:</p>
  
  <blockquote>
    <p>Could not find a base address that
    matches scheme http for the endpoint
    with binding BasicHttpBinding.
    Registered base address schemes are
    [https].</p>
  </blockquote>
  
  <p>It seems it doesn't know what the base address is, but how do I specify it? Here's the relevant section of my web.config file:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
    &lt;serviceHostingEnvironment&gt;
      &lt;baseAddressPrefixFilters&gt;
        &lt;add prefix="http://mywebsiteurl"/&gt;
      &lt;/baseAddressPrefixFilters&gt;
    &lt;/serviceHostingEnvironment&gt;
  
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior name="WcfPortalBehavior"&gt;
          &lt;serviceMetadata httpGetEnabled="true"/&gt;
          &lt;serviceDebug includeExceptionDetailInFaults="true"/&gt;
        &lt;/behavior&gt;
      &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;bindings&gt;
      &lt;basicHttpBinding&gt;
        &lt;binding name="BasicHttpBinding_IWcfPortal"
                 maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
                 receiveTimeout="00:10:00" sendTimeout="00:10:00"
                 openTimeout="00:10:00" closeTimeout="00:10:00"&gt;
          &lt;readerQuotas maxBytesPerRead="2147483647" maxArrayLength="2147483647"
                 maxStringContentLength="2147483647"/&gt;
        &lt;/binding&gt;
      &lt;/basicHttpBinding&gt;
    &lt;/bindings&gt;
  
    &lt;services&gt;
      &lt;service behaviorConfiguration="WcfPortalBehavior" name="Csla.Server.Hosts.Silverlight.WcfPortal"&gt;
        &lt;endpoint address="" binding="basicHttpBinding" contract="Csla.Server.Hosts.Silverlight.IWcfPortal"
        bindingConfiguration="BasicHttpBinding_IWcfPortal"&gt;
        &lt;/endpoint&gt;
        &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
      &lt;/service&gt;
    &lt;/services&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Can anybody shed some light on what's going on and how to fix it?</p>