none
Endpoint https + http. Could not find a base address that matches scheme http for the endpoint with binding CustomBinding. RRS feed

  • Question

  • I have a wcf service that will be hosted on a server with https. When I try to add a https endpoint I get the error "Could not find a base address that matches scheme http for the endpoint with binding CustomBinding" when I run it on my local machine. What do I need to in my web.config (and maybe IIS) and is it possible to have both a http endpoint and a https endpoint? I have tried lots of things and right now the system.servicemodel part of my config file looks like this:

    <system.serviceModel>   
        <services>
          <service name="CustomerSelectionExt.CustomerSelection">       
            <endpoint address="" binding="customBinding" bindingConfiguration="customBindingHTTP" contract="CustomerSelectionExt.ICustomerSelection" />
            <!--<endpoint address="" listenUri="" binding="customBinding" bindingConfiguration="customBindingHTTPS" contract="CustomerSelectionExt.ICustomerSelection" />-->       
          </service>
        </services>
        <bindings>     
          <customBinding>              
            <binding name="customBindingHTTP">
              <binaryMessageEncoding />         
              <httpTransport transferMode="Buffered"/>         
            </binding>
            <binding name="customBindingHTTPS">
              <binaryMessageEncoding />
              <httpsTransport transferMode="Buffered" />
            </binding>
          </customBinding>
        </bindings>
        <behaviors>
          <endpointBehaviors>
            <behavior name="webHttp">
              <webHttp />
            </behavior>
          </endpointBehaviors>
          <serviceBehaviors>
            <behavior>         
              <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>         
              <serviceDebug includeExceptionDetailInFaults="true"/>
            </behavior>
            </serviceBehaviors>
        </behaviors>
        <protocolMapping>
            <add binding="basicHttpsBinding" scheme="https" />
        </protocolMapping>   
        <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
      </system.serviceModel>

    Greatful if anyone can help me

    • Moved by BonnieBMVP, Moderator Friday, December 13, 2013 3:07 PM Moved from C# to a more appropriate forum
    Friday, December 13, 2013 1:55 PM

Answers

  • Hi,

    Yes, we can configure the wcf service to use the both Http and Https.

    Here is an example about the webHttpbinding, please try to check it:

    #Configuring WCF services to work with both HTTP and HTTPS :
    http://jayakrishnagudla.blogspot.in/2009/12/configuring-wcf-services-to-work-with.html .

    And for your question, please try to first add the following to see if it helps:

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

    Then if the above can not help, please try to enable the WCF tracing to find the cause.

    #How to enable the WCF tracing:
    http://msdn.microsoft.com/en-us/library/ms733025(v=vs.110).aspx .

    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.

    Monday, December 16, 2013 8:34 AM
    Moderator

All replies