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

    Question

  • I have a WCF web service that will be called with JSON and return a stream. If I add a web page in the same solution and make the call it works just fine. If I use the WCF test client no method is displayed. When the service is installed on the server and the call is made by https I get the error "Could not find a base address that matches scheme http for the endpoint with binding WebHttpBinding. Registered base address schemes are [https]." What do I need to do? Guess it is something in the web.config... I haven't found anything on the internet that solves my problem...

    This is the service contract:

    [ServiceContract]
        public interface ICustomerSelection
        {
            [OperationContract]
            [WebInvoke(UriTemplate = "getCustomers", BodyStyle = WebMessageBodyStyle.WrappedRequest, RequestFormat = WebMessageFormat.Json, Method = "POST")]
            Stream GetC5mail(string key, string procedure, string mode, Filter filter, Options options);
        }

    part of web.config:

    <system.serviceModel>
        <services>
          <service name="CustomerSelectionExt.CustomerSelection" behaviorConfiguration="ServiceBehavior">
            <endpoint address="" binding="webHttpBinding" contract="CustomerSelectionExt.ICustomerSelection" behaviorConfiguration="webHttp" />
            <endpoint contract="IMetadataExchange" binding="mexHttpBinding" address="mex"/>
          </service>
        </services>

        <behaviors>
          <endpointBehaviors>
            <behavior name="webHttp">
              <webHttp />
            </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior name="ServiceBehavior">
              <!-- To avoid disclosing metadata information, set the values below to false before deployment -->
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
              <!-- To receive exception details in faults for debugging purposes, set the value below to true.  Set to false before deployment to avoid disclosing exception information -->
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
          </serviceBehaviors>
        </behaviors>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>   
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    </system.serviceModel>

    Grateful for help...

    Thursday, December 05, 2013 2:23 PM

Answers

  • Hi,

    If you want to use the https with the WCF rest service, please try to check the following:

    1. Under bindings tag make sure you have set<security mode="Transport" /> i.e:

          <webHttpBinding>
            <binding name="myBinding" maxBufferSize="2147483647"  maxReceivedMessageSize="2147483647" >
              <readerQuotas  maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
                maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
                <security mode="Transport" />
            </binding>
          </webHttpBinding>

    2. Also please try to use the mexHttpsBinding:

         <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>

    For more information, please try to check this article:
    #Exposing WCF REST Service over HTTPS:
    http://debugmode.net/2011/05/09/exposing-wcf-rest-service-over-https/ .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 06, 2013 8:05 AM
    Moderator
  • Hi,

    Please first add the base address for the https:

     <baseAddresses>
          <add baseAddress=https://localhost:10201/Service />
        </baseAddresses>

    Then please try to refer to this similar thread:
    http://stackoverflow.com/questions/13402777/error-with-service-endpoint-in-wcf-https-ssl-cannot-find-base-address-that-matc .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, December 19, 2013 8:30 AM
    Moderator

All replies

  • Hi,

    If you want to use the https with the WCF rest service, please try to check the following:

    1. Under bindings tag make sure you have set<security mode="Transport" /> i.e:

          <webHttpBinding>
            <binding name="myBinding" maxBufferSize="2147483647"  maxReceivedMessageSize="2147483647" >
              <readerQuotas  maxDepth="2147483647" maxStringContentLength="2147483647" maxArrayLength="2147483647" 
                maxBytesPerRead="2147483647" maxNameTableCharCount="2147483647"/>
                <security mode="Transport" />
            </binding>
          </webHttpBinding>

    2. Also please try to use the mexHttpsBinding:

         <endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>

    For more information, please try to check this article:
    #Exposing WCF REST Service over HTTPS:
    http://debugmode.net/2011/05/09/exposing-wcf-rest-service-over-https/ .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, December 06, 2013 8:05 AM
    Moderator
  • Thank you for the help. I tried this, but still get the same error :-(
    Friday, December 06, 2013 8:48 AM
  • Hi,

    Please first add the base address for the https:

     <baseAddresses>
          <add baseAddress=https://localhost:10201/Service />
        </baseAddresses>

    Then please try to refer to this similar thread:
    http://stackoverflow.com/questions/13402777/error-with-service-endpoint-in-wcf-https-ssl-cannot-find-base-address-that-matc .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Thursday, December 19, 2013 8:30 AM
    Moderator