title: Keep getting WCF error despite making changes to web config and host factory
body: <p>On my developer box, my WCF service works well with no problems, but when I deploy it on my shared server, I get the following error message when I try to access my service</p>
  
  <pre><code>https://www.mydomain.com/Admin/myservice/service.svc:
  </code></pre>
  
  <blockquote>
    <p>The service '/admin/myservice/service.svc' cannot be activated due to
    an exception during compilation. The exception message is: This
    collection already contains an address with scheme http. There can be
    at most one address per scheme in this collection. If your service is
    being hosted in IIS you can fix the problem by setting
    'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'
    to true or specifying
    'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
    Parameter name: item.; This collection already contains an address
    with scheme http. There can be at most one address per scheme in this
    collection. If your service is being hosted in IIS you can fix the
    problem by setting
    'system.serviceModel/serviceHostingEnvironment/multipleSiteBindingsEnabled'
    to true or specifying
    'system.serviceModel/serviceHostingEnvironment/baseAddressPrefixFilters'.
    Parameter name: item</p>
  </blockquote>
  
  <p>Here's the pertinent web.config configuration:</p>
  
  <pre><code>&lt;serviceHostingEnvironment aspNetCompatibilityEnabled="true"&gt;
      &lt;baseAddressPrefixFilters&gt;
          &lt;add prefix="https://www.mydomain.com/"/&gt;
      &lt;/baseAddressPrefixFilters&gt;
  &lt;/serviceHostingEnvironment&gt; 
  </code></pre>
  
  <p>Here's my host factory code:</p>
  
  <pre><code>public class MyServiceServiceHostFactory : ServiceHostFactory
  {
      protected override ServiceHost CreateServiceHost(Type serviceType, Uri[] baseAddresses)
      {
          ServiceHost serviceHost = null;
  
          serviceHost = CreateMyServiceServiceHost(baseAddresses);
  
          return serviceHost;
      }
  
      private static ServiceHost CreateMyServiceServiceHost(Uri[] baseAddresses)
      {
          // initialize service host
          ServiceHost serviceHost = new ServiceHost(typeof(OrderServices), baseAddresses);
  
          // create and add service endpoint binding using message and user name
          WSHttpContextBinding wsHttpContextEndpointBinding = new WSHttpContextBinding(SecurityMode.TransportWithMessageCredential);
          wsHttpContextEndpointBinding.Security.Message.ClientCredentialType = MessageCredentialType.UserName;
          wsHttpContextEndpointBinding.Security.Transport.ClientCredentialType = HttpClientCredentialType.None;
          wsHttpContextEndpointBinding.AllowCookies = true;
  
          // add meta data service
          ServiceMetadataBehavior metadataBehavior = new ServiceMetadataBehavior();
          metadataBehavior.HttpGetEnabled = false;
          metadataBehavior.HttpsGetEnabled = true;
          metadataBehavior.MetadataExporter.PolicyVersion = PolicyVersion.Policy15;
  
          ServiceAuthorizationBehavior serviceAuthorizationBehavior =
          serviceHost.Description.Behaviors.Find&lt;ServiceAuthorizationBehavior&gt;();
          serviceAuthorizationBehavior.PrincipalPermissionMode = PrincipalPermissionMode.UseAspNetRoles;
  
          ServiceDebugBehavior serviceDebugBehavior =
          serviceHost.Description.Behaviors.Find&lt;ServiceDebugBehavior&gt;();
          serviceDebugBehavior.IncludeExceptionDetailInFaults = true;
  
          ServiceCredentials serviceCredentials = new ServiceCredentials();
          serviceCredentials.UserNameAuthentication.UserNamePasswordValidationMode = UserNamePasswordValidationMode.Custom;
          serviceCredentials.UserNameAuthentication.CustomUserNamePasswordValidator =
              new MyServiceUserNamePasswordValidator((MyServiceMembershipProvider) Membership.Providers["MyServiceMembershipProvider"]);
  
          serviceHost.Description.Behaviors.Add(metadataBehavior);
          serviceHost.Description.Behaviors.Add(serviceCredentials);
  
          serviceHost.AddServiceEndpoint(typeof(IOrderServices), wsHttpContextEndpointBinding, "");
  
          // Add MEX endpoint
          serviceHost.AddServiceEndpoint(ServiceMetadataBehavior.MexContractName, MetadataExchangeBindings.CreateMexHttpsBinding(), "mex");
          return serviceHost;
      }
  }
  </code></pre>
  
  <p>Why am I getting this error?  Every technical document says that I am doing things correctly according to the documentation.  Could this be related to a problem with SSL or the host name issues?  This has me stumped.</p>