Force HTTPS(SSL) on a WCF WebGet method

1.3k views Asked by At

I have a method like this:

[WebGet(UriTemplate = "/")]
        [OperationContract]
        public XmlElement All() {}

Is there a way to force clients to always use HTTPS? (deny HTTP and allow only HTTPS)?

If yes, how?

Thank you

1

There are 1 answers

2
Stephen Wrighton On BEST ANSWER

This is IIS configuration.

When you're creating the IIS website to host the WCF service, you would set the bindings on it to only respond on the SSL socket.

Furthering that, you can set up IIS to force redirects from http://www.example.com to https://www.example.com

Here's a tutorial: http://learn.iis.net/page.aspx/144/how-to-set-up-ssl-on-iis/