locked
Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https]. RRS feed

  • Question

  • User1481675374 posted

    Hello Friends,

    My Web.config File are given below:-

    <?xml version="1.0"?>
    <configuration>
    <connectionStrings>
    <add name="DBConnectionString" connectionString="Data Source=SIVA\SQLEXPRESS2012;Failover Partner=SIVA\SQLEXPRESS2012;Initial Catalog=FuelBuddy;Persist Security Info=True;User ID=sa;Password=mssql;MultipleActiveResultSets=True;Connection Timeout=30; Min Pool Size=20;Max Pool Size=100" />
    </connectionStrings>
    <appSettings>

    </appSettings>
    <system.web>
    <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    <compilation debug="true" targetFramework="4.0" />
    </system.web>
    <system.webServer>
    <modules runAllManagedModulesForAllRequests="true">
    <!--<clear/>-->
    <add name="UrlRoutingModule"
    type="System.Web.Routing.UrlRoutingModule,
    System.Web.Routing, Version=4.0.0.0,
    Culture=neutral,
    PublicKeyToken=31BF3856AD364E35" />
    </modules>
    <handlers>
    <add name="UrlRoutingHandler"
    preCondition="integratedMode"
    verb="*" path="UrlRouting.axd"
    type="System.Web.HttpForbiddenHandler,
    System.Web, Version=4.0.0.0, Culture=neutral,
    PublicKeyToken=b03f5f7f11d50a3a" />
    </handlers>
    </system.webServer>
    <system.serviceModel>
    <serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
    <bindings>
    <webHttpBinding>
    <binding name="SecureWebBinding">
    <security mode="Transport">
    <transport clientCredentialType="None" proxyCredentialType="None" />
    </security>
    </binding>

    </webHttpBinding>
    </bindings>
    <services>
    <service name="NSFuelBuddyServices.FuelBuddyService"
    behaviorConfiguration="RESTBehavior">
    <endpoint address=""
    binding="webHttpBinding" bindingConfiguration="SecureWebBinding"
    contract="NSFuelBuddyServices.IFuelBuddyService"
    behaviorConfiguration="MyEndpointBehavior"/>
    </service>
    </services>
    <behaviors>
    <serviceBehaviors>
    <behavior name="RESTBehavior">
    <serviceMetadata httpGetEnabled="false"/>
    <serviceDebug includeExceptionDetailInFaults="true"/>
    </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
    <behavior name="MyEndpointBehavior">
    <webHttp />
    </behavior>
    </endpointBehaviors>
    </behaviors>

    </system.serviceModel>
    </configuration>

    they successfully build but on executing WCF Service Host They give following error:-

    System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].
    at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)
    at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress, Boolean skipHost)
    at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection)
    at System.ServiceModel.ServiceHostBase.ApplyConfiguration()

    Wednesday, September 19, 2018 10:19 AM

All replies

  • User1120430333 posted

    System.InvalidOperationException: Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].
    at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses)

    Communications happen between the client and the service, becuase the client knows the endpoint IP address of the service. I see nowhere in the web.config that you have presented an IP address that points to the address of the service that is being hosted by a machine.

    Thursday, September 20, 2018 4:20 PM
  • User-330142929 posted

    Hi kdsingh1,

    According to your web configuration, I try to restore your problem, but I failed. I only get the following errors which are different from your errors.

    Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http].

    Could you please tell me how do you get your following errors? Have you hosted the WCF application on the IIS, and get the error when browsing the SVC file? Or you just check the SVC file by selecting the “View in browser” in Visual Studio? Or do you host WCF in other ways?

    Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https].

    From the surface of the error message,The service endpoint needs to be configured as an endpoint of an HTTP scheme, not an endpoint of an HTTPS scheme.

    I try to add a base address in a console application, and the base address is an https scheme. It works like a charm.

       <services>
    
          <service name="sv"
    
          behaviorConfiguration="RESTBehavior">
    
            <endpoint address=""
    
            binding="webHttpBinding" bindingConfiguration="SecureWebBinding"
    
            contract="isv"
    
            behaviorConfiguration="MyEndpointBehavior"/>
    
            <host>
    
              <baseAddresses>
    
                <add baseAddress="https://localhost:2200"/>
    
              </baseAddresses>
    
            </host>
    
          </service>
    
    </services>

    As you know, if the WCF hosted on IIS, the base addresses are provided by the IIS, which could be HTTP scheme or https scheme.

    I would be appreciated that you could post more about your project so that I could give you an effective reply.

    Feel free to contact me if you have any questions.

    Best Regards

    Abraham

    Monday, September 24, 2018 9:10 AM