title: Two endpoints for same service in WCF, one secured one not
body: <p>I have a .Net service running on IIS 6 and WCF that I want to create two endpoints for. One secured with HTTPS and Basic authentication that will be accessed from our DMZ and one endpoint with no security that will only be accessible from the internal secure network. A firewall and maybe .Net filters will ensure that the unsecured service is not accessible outside the secure network.</p>
  
  <p>So far I have not been successful getting two endpoints working with different security parameters. One configuration I tried is:</p>
  
  <pre><code>&lt;service name="My.Service"&gt;
      &lt;host&gt;
          &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost/MyService/"/&gt;
          &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;endpoint address="UnSecuredAccessToMyService.svc" 
                behaviorConfiguration="restBehavior" 
                name="UnSecureEndpoint" 
                binding="webHttpBinding"
                bindingName="SomeBindingName" 
                bindingNamespace="http://mydomain/myservice" 
                contract="Domain.MyService.MyClass" /&gt;
      &lt;endpoint address="SecuredAccessToMyService.svc"
                behaviorConfiguration="secBehavior"
                name="SecuredEnpoint"
                binding="webHttpBinding"
                bindingConfiguration="customSecureBinding"
                bindingName="SecBindingName"
                bindingNamespace="http://mydomain/myservice"
                contract="Domain.MyService.MyClass" /&gt;
  &lt;/service&gt;
  
  &lt;behaviors&gt;
      &lt;endpointBehaviors&gt;
          &lt;behavior name="restBehavior"&gt;
              &lt;webHttp /&gt;
          &lt;/behavior&gt;
          &lt;behavior name="secBehavior"&gt;
          &lt;/behavior&gt;
      &lt;/endpointBehaviors&gt;
  &lt;/behaviors&gt;
  
  &lt;bindings&gt;
      &lt;webHttpBinding&gt;
          &lt;binding name="customSecureBinding"&gt;
              &lt;security mode="Transport"&gt;
                  &lt;transport clientCredentialType="Basic"/&gt;
              &lt;/security&gt;
          &lt;/binding&gt;
      &lt;/webHttpBinding&gt;
  &lt;/bindings&gt;
  </code></pre>
  
  <p>The files UnSecuredAccessToMyService.svc and SecuredAccessToMyService.svc look like:</p>
  
  <pre><code>&lt;%@ ServiceHost
      Factory="somefactory, anotherfactory"
      Service="My.Service, AnotherService"
  %&gt;
  </code></pre>
  
  <p>I am very new to WCF and .Net so extra details could really help, Thanks!</p>