'Configuring a WCF service (Web.config) - HttpsGetEnabled, HttpsGetUrl

I am trying to deploy a Silverlight with WCF Service to a hosting. Basically, I have the same problem as this guy: How to configure WCF services to work through HTTPS without HTTP binding? Except the solutions don't work for me.

//edit: I've been pasting it wrong, but it still doesn't work.

I have tried Ladislav Mrnka's answer - changed this in the Web.config file:

  <serviceMetadata httpGetEnabled="false" httpsGetEnabled="true" />

The dreaded error still appears when I navigate to the .svc file on the server:

The HttpsGetEnabled property of ServiceMetadataBehavior is set to true and the
HttpsGetUrl property is a relative address, but there is no https base address.
Either supply an https base address or set HttpsGetUrl to an absolute address.


Solution 1:[1]

Now it should be all correct, I just changed the httpGetEnabled and httpsGetEnabled in the proper place (it's already in the config file). But I still get the error. Should I perhaps specify the HttpsGetUrl somewhere? Where?

Yes, see here.

Should be:

<behaviors>
 <serviceBehaviors>
  <behavior name="NewBehavior">
    <serviceMetadata httpsGetEnabled="true" 
     httpsGetUrl="https://myComputerName/myEndpoint" />
  </behavior>
 </serviceBehaviors>
</behaviors>

Solution 2:[2]

This error happened because the setting is logically wrong. If you enable the httpsGetEnabled means, you allow clients to retrieve metadata via https. And if you don't provide a URL about https, how can clients retrieve metadata from https. So the error message alert you to provide a URL.

Either supply an https base address or set HttpsGetUrl to an absolute address.

You have three options.

  1. Provide httpsGetUrl as other answers showed above
  2. Binding an address via IIS

Bindings Site Bindings

(if you are still developing in visual studio then you only need to degug with SSL Enabled mode ) SSL Enabled

  1. Set httpsGetEnabled to false

Solution 3:[3]

In configuration, under behaviour where you have set httpsGetEnabled="true", Set httpsGetUrl="https://UserSystemName/EndPointName" too and problem resolved.

<behaviors>
  <serviceBehaviors>
    <behavior name="mexBehaviour">
      <serviceMetadata httpsGetEnabled="true" httpsGetUrl="https:///UserSystemName/EndPointName"/>
    </behavior>
  </serviceBehaviors>
</behaviors>

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Marcel N.
Solution 2
Solution 3