sovemp
sovemp

Reputation: 1413

Configuration for web service metadata gives error over https

I know there are threads about this, but I just am not seeing what I'm doing wrong here. With the following config, when I try to hit the service over https I get the following error: Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].` This is the relevant section of my web.config. Thanks.

<system.serviceModel>

    <bindings>
        <wsHttpBinding>
            <binding name="sslBindingConfig">
                <security mode="Transport">
                    <transport clientCredentialType="None" />
                </security>
            </binding>
        </wsHttpBinding>
    </bindings>

    <services>
        <service name="MEA.SAWS.Service.SARuleService" behaviorConfiguration="ServiceBehavior">
            <!-- Service Endpoints -->
            <endpoint address="" 
                      binding="wsHttpBinding" 
                      bindingConfiguration="sslBindingConfig"
                      contract="MEA.SAWS.ServiceContract.ISARuleService">
            </endpoint>                                                      

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

    <behaviors>
        <serviceBehaviors>
            <behavior name="ServiceBehavior">
                <!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
                <serviceMetadata 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>

</system.serviceModel>

Upvotes: 1

Views: 184

Answers (2)

sovemp
sovemp

Reputation: 1413

If this might help someone else in the future I figured this out. The problem was that all of the servers behind the load balancer were bound only to https, whereas the load balancer was SSL. So basically the WCF adage that the bindings must always match exactly doesn't apply here. The client calls had to be configured as https, but the server endpoints had to be configured http.

Upvotes: 1

chief7
chief7

Reputation: 14383

Change the binding on the service endpoint to wsHttpsBinding not wsHttpBinding:

    <endpoint address="" 
              binding="wsHttpsBinding" 
              bindingConfiguration="sslBindingConfig"
              contract="MEA.SAWS.ServiceContract.ISARuleService">

Upvotes: 1

Related Questions