Question

I'm trying to deploy a WCF-service, but I'm having dificulties getting the final bits to work. I'm not a deployment guru in any way, so please bear with me.

I'm using a WebHttpBinding to make Ajax calls to the service using JSON, but I receive the error: "Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [].".

Here is a snippet of my web.config:

<system.serviceModel>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true">
      <baseAddressPrefixFilters>
        <add prefix="http://mysite.com/" />
      </baseAddressPrefixFilters>
    </serviceHostingEnvironment>
    <bindings>
        <webHttpBinding>
            <binding name="webHttp">
                <security mode="None">
                    <transport clientCredentialType="None"
                    proxyCredentialType="None"
                    realm="string" />
                </security>
            </binding>
        </webHttpBinding>
    </bindings>
        <services>  
      <service name="LicenseManager.LicenseService" behaviorConfiguration="ServiceAspNetAjaxBehavior">
        <endpoint address="" behaviorConfiguration="AjaxBehavior"
         binding="webHttpBinding" contract="LicenseManager.ILicenseService" />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <host>
               <baseAddresses>
                    <add baseAddress="http://mysite.com/" />
               </baseAddresses>
          </host>
      </service>
    </services>
    <behaviors>
      <endpointBehaviors>
        <behavior name="AjaxBehavior">
          <enableWebScript/>
        </behavior>
      </endpointBehaviors>
      <serviceBehaviors>
        <behavior name="ServiceAspNetAjaxBehavior">
          <serviceMetadata httpGetEnabled="true" httpGetUrl="" />
          <serviceDebug httpHelpPageEnabled="true" includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors> 
    </behaviors>
  </system.serviceModel>

I've made so many changes and tried so many options that I honestly lost overview of what I'm doing. I hope you can find that tiny error that make it all work.

Thank you.

Was it helpful?

Solution 2

The error was caused by a silly mistake made by me. My DNS was not set up yet, so I used GoDaddy's "Preview DNS" feature that lets me view the website before the DNS is set up. I used the preview address (mydomain.com.previewdns.com) when I should just have used mydomain.com.

My bad, thanks for the help!

OTHER TIPS

Is your site running directly under http://mysite.com, or is it running under an application/vdir under that site? If so, add the application in your <baseAddressPrefixFilter> element:

  <baseAddressPrefixFilters>
    <add prefix="http://mysite.com/MyApplication" />
  </baseAddressPrefixFilters>

I don't think you need the trailing / either - but I don't think that's causing the issue.

Hopefully this helps! Let em know and I'll update my answer accordingly.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top