title: How to configure basicHttpBinding for WCF service
body: <p>I have a WCF service that I'm trying to get to work with wcf, old soap and plain xml.  The service is called TestService.svc and the configuration looks like this:</p>
  
  <pre><code> &lt;system.serviceModel&gt;
    &lt;behaviors&gt;
     &lt;serviceBehaviors&gt;
      &lt;behavior name="TestServiceBehavior"&gt;
       &lt;serviceMetadata httpGetEnabled="true"/&gt;
       &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
      &lt;/behavior&gt;
     &lt;/serviceBehaviors&gt;
     &lt;endpointBehaviors&gt;
      &lt;behavior name="poxBehavior"&gt;
       &lt;webHttp/&gt;
      &lt;/behavior&gt;
     &lt;/endpointBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;services&gt;
     &lt;service behaviorConfiguration="TestServiceBehavior" name="TestService"&gt;
      &lt;endpoint address="" binding="wsHttpBinding" contract="ITestService"&gt;
       &lt;identity&gt;
        &lt;dns value="localhost"/&gt;
       &lt;/identity&gt;
      &lt;/endpoint&gt;
      &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/&gt;
      &lt;endpoint address="soap" binding="basicHttpBinding" contract="ITestService"/&gt;
      &lt;endpoint address="xml" binding="webHttpBinding"  behaviorConfiguration="poxBehavior" contract="ITestService"/&gt;
     &lt;/service&gt;
    &lt;/services&gt;
   &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>I got this code from this other question:
  <a href="https://stackoverflow.com/questions/186631/rest-soap-endpoints-for-a-wcf-service">REST / SOAP endpoints for a WCF service</a></p>
  
  <p>Now, the XML webHttpBinding seems to work well, but the wsHttpBinding and basicHttpBinding does not work very well.</p>
  
  <p>I can browser to the service using:
  <a href="http://localhost:8295/WCFTest/TestService.svc" rel="nofollow noreferrer">http://localhost:8295/WCFTest/TestService.svc</a></p>
  
  <p>I can also use that endpoint to add a service reference in an asp.net web site project and attempt to consume the service, but when I create the client:</p>
  
  <pre><code>TestService.TestServiceClient mytest = new TestService.TestServiceClient();
  </code></pre>
  
  <p>It says to specify an endpoint due to multiple endpoints.  I guess due to having both wsHttp and basicHttp?  How do I specify the endpoint here?</p>
  
  <p>Next I try to consume the basicHttpBinding endpoint by adding a Web Reference (not service reference) to a .net 2.0 web site.  At this point I'm not able to add the reference and receive an error 400.</p>
  
  <p>So next I remove the wsHttp binding and am able to add the web reference and consume the service via a .net 2.0 client.</p>
  
  <p>How do I configure it so that I can use wsHttpBinding for clients that can consume normal WCF services, basicHttpBinding for clients that can only consume older non-WCF SOAP requests and still have webHttpBinding available for clients that want to consume plain xml?</p>