title: WCF base address not found
body: <p>My service can work with normal WCF calls, but to expose metadata (the wsdl file) I have to change configuration in such a way the normal WCF host fails.</p>
  
  <p>I've spend countless hours on google trying to solve this, big problem there is that hosting a service inside a website is never discussed (yes this is different).</p>
  
  <p>requirements:</p>
  
  <ul>
  <li>Runs in an existing web site</li>
  <li>Use sessions</li>
  <li>Operable with Java, and as much .net versions as possible.</li>
  <li>Expose metadata (wsdl will be enough)</li>
  </ul>
  
  <p>edits:</p>
  
  <ul>
  <li>IIS cannot be used</li>
  <li>I'm using .NET 4 and WCF 4.</li>
  </ul>
  
  <p>In this configuration the metadata can be reached (through the wsdl file) but when trying to host the normal wcf endpoints I get and InvalidOperationException:</p>
  
  <p><em>Could not find a base address that matches scheme http for the endpoint with binding WSHttpBinding. Registered base address schemes are [].</em></p>
  
  <p>So the base address is ignored.</p>
  
  <p>But when I supply full addresses to the endpoints (simply copy the base address in front of the current address) the normal WCF calls work fine, but when trying to access metadata I get the following error:
  <em>No protocol binding matches the given address '<a href="http://localhost:8080/Functionality" rel="nofollow noreferrer">http://localhost:8080/Functionality</a>'.</em> </p>
  
  <p>Protocol bindings are configured at the Site level in IIS or WAS configuration. </p>
  
  <p>Here is the web.config serviceModel section, I made a small test web site just for testing this, but it would be to much to post all of it here, if you send me a pm though I will e-mail it to you.</p>
  
  <pre><code> &lt;system.serviceModel&gt;
    &lt;services&gt;
     &lt;service behaviorConfiguration="metadataSupport" name="MyStuff.TestWithMetadata"&gt;
      &lt;endpoint address="Functionality" binding="wsHttpBinding" name="FunctionalityBinding"
       contract="MyStuff.ITestWithMetadata" /&gt;
      &lt;host&gt;
       &lt;baseAddresses&gt;
        &lt;add baseAddress="http://localhost:8080/" /&gt;
       &lt;/baseAddresses&gt;
      &lt;/host&gt;
     &lt;/service&gt;
    &lt;/services&gt;
    &lt;behaviors&gt;
     &lt;endpointBehaviors&gt;
      &lt;behavior name="metadataSupport"&gt;
       &lt;webHttp /&gt;
      &lt;/behavior&gt;
     &lt;/endpointBehaviors&gt;
     &lt;serviceBehaviors&gt;
      &lt;behavior name="metadataSupport"&gt;
       &lt;!--Navigate with browser to httpGetUrl for the wsdl file--&gt;
       &lt;serviceMetadata httpGetEnabled="true" httpGetUrl="Metadata" /&gt;
       &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
      &lt;/behavior&gt;
     &lt;/serviceBehaviors&gt;
    &lt;/behaviors&gt;
    &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="false"&gt;
     &lt;serviceActivations&gt;
      &lt;add relativeAddress="TestWithMetadata.svc" service="MyStuff.TestWithMetadata" /&gt;
     &lt;/serviceActivations&gt;
    &lt;/serviceHostingEnvironment&gt;
   &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>If anyone has any ideas on how to solve this, please help out.</p>