WCF WSDL over HTTPS returns 403 Forbidden

wcfwcf-bindingwsdl

I have a wcf service that loads and the wsdl link works over http. When you try https, the service page loads (ssl cert is ok, etc). My problem is that the link to the wsdl returns a 403 forbidden when requested over ssl.

I have found a number of posts related to the host header:

http://www.codemeit.com/wcf/wcf-wsdl-xsdimport-schemalocations-link-to-local-machine-name-not-domain-name-while-hosted-in-iis.html

http://www.jstawski.com/archive/2008/05/01/wcf-wsdl-location-address-with-https.aspx

http://gavinmckay.wordpress.com/2009/03/24/howto-fix-wcf-host-name-on-iis/

However, my http and https urls are the same (minus the http/https), so my host header does not seem to be the issue. Those seem to be about generating the wrong url to the wsdl (with machine name instead of domain name), but I don't think that is my issue (mine has the domain name correct).

Best Answer

It turned out to be conflicting errors. In development using the Visual Studio Development Server, instead of iis, I got this error:

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.

That led me to add the httpsGetUrl to the web.config. It turns out that in production, removing that all together, even though it matched the desired url, fixed the issue.