My current configuration looks like this:
<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true"/> <standardEndpoints> <webHttpEndpoint> <standardEndpoint helpEnabled="true" automaticFormatSelectionEnabled="true" maxReceivedMessageSize="5242880"> <readerQuotas maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647" /> </standardEndpoint> </webHttpEndpoint> </standardEndpoints> </system.serviceModel>
This works when I have the http and https bindings configured for my site.
I connect to the service via https and everything works fine.
Now I want to completely remove the http binding for IIS. And I started getting this error:
Could not find a base address that matches the http scheme for the endpoint with WebHttpBinding. Schemes of registered base addresses [https].
[InvalidOperationException: Could not find a base address that matches the http scheme for the endpoint with WebHttpBinding. registered base address patterns [https].]
System.ServiceModel.ServiceHostBase.MakeAbsoluteUri (Uri relativeOrAbsoluteUri, Binding Binding, UriSchemeKeyedCollection baseAddresses) +16582113
System.ServiceModel.Description.ConfigLoader.ConfigureEndpointAddress (ServiceEndpointElement serviceEndpointElement, host ServiceHostBase, ServiceEndpoint endpoint) +117
System.ServiceModel.Description.ConfigLoader.ConfigureEndpoint (StandardEndpointElement standardEndpointElement, ServiceEndpointElement serviceEndpointElement, context information context, ServiceHostBase host, ServiceDescription description, ServiceEndpoint & endpoint, Boolean omitSettingEndpointdress)
System.ServiceModel.Description.ConfigLoader.LookupEndpoint (ServiceEndpointElement serviceEndpointElement, context information context, ServiceHostBase host, ServiceDescription description, Boolean omitSettingEndpointAddress) +8728167
System.ServiceModel.Web.WebServiceHost.AddAutomaticWebHttpBindingEndpoints (ServiceHost host, IDictionary`2 implementedContracts, String multipleContractsErrorMessage, String standardEndpointKind) +982
System.ServiceModel.Web.WebServiceHost.OnOpening () +311
System.ServiceModel.Channels.CommunicationObject.Open (TimeSpan timeout) +612
System.ServiceModel.HostingManager.ActivateService (String normalizedVirtualPath) +255
System.ServiceModel.HostingManager.EnsureServiceAvailable (String normalizedVirtualPath) +1172
[ServiceActivationException: service / DEMO / mobile cannot be activated due to an exception at compile time. Exception message: Could not find a base address that matches the http scheme for the endpoint with WebHttpBinding. Registered base address of the scheme [https] ..] System.Runtime.AsyncResult.End (IAsyncResult result) +901424
System.ServiceModel.Activation.HostedHttpRequestAsyncResult.End (IAsyncResult result) +178702
System.Web.CallHandlerExecutionStep.OnAsyncHandlerCompletion (IAsyncResult ar) +136
I found a sample set for WCF, but WCF REST looks different on the configuration side, and I want to understand why it compiles. From the look of my configuration - it should not work on SSL at all, but it works when there is an https binding.