I have tried Google and also other posts on SO, nothing I have tried has resolved my issue so far.
I thought this was going to be the answer. No dice.
I also read through most of the posts here on SO that mentioned the same error message I’m receiving, like this.
My site is secure, https. I have 3 WCF services that handle my async ajax stuff running on this site. When I attempt to access any of those services I receive this error:
Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].
My config:
<behaviors>
<endpointBehaviors>
<behavior name="ajaxBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ajaxAsynchBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="webBinding">
<security mode="Transport" />
</binding>
</webHttpBinding>
</bindings>
<services>
<service name="MyApp.Web.Services.CascadingList">
<endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.CascadingList" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://[domain]/MyApp/Services/CascadingList.svc" />
</baseAddresses>
</host>
</service>
<service name="MyApp.Web.Services.AutoComplete">
<endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.AutoComplete" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://[domain]/MyApp/Services/AutoComplete.svc" />
</baseAddresses>
</host>
</service>
<service name="MyApp.Web.Services.Validation">
<endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
binding="webHttpBinding" bindingConfiguration="webBinding" contract="MyApp.Web.Services.Validation" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://[domain]/MyApp/Services/Validation.svc" />
</baseAddresses>
</host>
</service>
</services>
I should be able to go to “https://[domain]/MyApp/SubmitNew.aspx” and the cascading lists should work.
Currently the “parent” list shows “[Method 500]” and the child lists remain disabled.
When I hit the “SubmitNew” page, my server’s event log shows “Sender Information: System.ServiceModel.Activation.HostedHttpRequestAsyncResult/51442863 Exception: System.ServiceModel.ServiceActivationException: The service ‘/MyApp/Services/CascadingList.svc’ cannot be activated due to an exception during compilation. The exception message is: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].“
If I navigate directly to “https://[domain]/MyApp/Services/CascadingList.svc” I also receive the aforementioned error.
UPDATES
This happens on our production server. Secure site w/ SSL cert was set up long before I joined the company. I just added a new virtual directory under the secure site for my new web app.
In IIS:
Secure Web Applications (has SSL cert)
MyApp
WebApp1
WebApp2
I fixed my config (above) to use the correct behaviorConfiguration.
— 2012.04.24 13:15 CDT —
When I changed my config to this (below) I received this error: “System.ServiceModel.ServiceActivationException: The service ‘/MyApp/Services/CascadingList.svc’ cannot be activated due to an exception during compilation. The exception message is: There is no endpoint behavior named ‘ajaxAsynchBehavior’“
<serviceBehaviors>
<behavior name="ajaxAsynchBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
<services>
<service name="MyApp.Web.Services.CascadingList">
<endpoint address="" behaviorConfiguration="ajaxAsynchBehavior"
binding="basicHttpBinding" bindingConfiguration="ajaxBinding" contract="MyApp.Web.Services.CascadingList" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://[domain]/MyApp/Services/CascadingList.svc" />
</baseAddresses>
</host>
</service>
.
.
.
</services>
So I changed it back to:
<behaviors>
<endpointBehaviors>
<behavior name="ajaxBehavior">
<enableWebScript />
</behavior>
<behavior name="clientBehavior" />
</endpointBehaviors>
<serviceBehaviors>
<behavior name="ajaxAsynchBehavior">
<serviceMetadata httpsGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="MyApp.Web.Services.CascadingList">
<endpoint address="" behaviorConfiguration="ajaxBehavior"
binding="basicHttpBinding" bindingConfiguration="ajaxBinding" contract="MyApp.Web.Services.CascadingList" />
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="https://[domain]/MyApp/Services/CascadingList.svc" />
</baseAddresses>
</host>
</service>
.
.
.
</services>
Your configuration looks fine, except for the service behaviors which will not be attached as you did not add the
behaviorConfigurationwith proper name in the<service>tags. But this is not causing your error.Are you by any chance using the Visual Studio built-in web server (Cassini)? Because it looks like you do and please keep in mind that it does not support HTTPS. This is probably why you are getting the error. Try deploying your site to local IIS server and check if it works then. You can see how to set up a https development web site on IIS 7 here. One more thing, once you deploy the site to IIS keep in mind that the
baseAddresstags will be ignored but your services will be accessible by their original names ie CascadingList.svc (unless configured differently).