I am trying to convert a WCF service from http to https.
It is using a self-signed certificate.
I can browse to the service using web browser, but when I try to add it as a web reference in another .Net app, I get the following error:
There was an error downloading
https://localhost:40300/DBService/SPService.svc/_vti_bin/ListData.svc/$metadata
.
The request failed with HTTP status 403: Forbidden.
I have tried editing the web.config in various ways according to lots of Googling, but still have the above error with no way to narrow down the cause...
Here is my web.config:
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="DatabaseServer" value="Server2008"/>
<add key="Database" value="Licensor"/>
<add key="VerboseLogging" value="True"/>
</appSettings>
<system.web>
<compilation targetFramework="4.0"/>
<httpRuntime/>
</system.web>
<system.serviceModel>
<services>
<service name="DBService.SPService">
<endpoint address="https://localhost/DBService/SPService.svc"
binding="basicHttpBinding"
bindingConfiguration="secureHttpBinding"
contract="DBService.IService1"/>
<endpoint address="mex"
binding="mexHttpsBinding"
contract="IMetadataExchange" />
</service>
</services>
<bindings>
<basicHttpBinding>
<binding name="secureHttpBinding">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<serviceMetadata httpGetEnabled="true" httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<!--<protocolMapping>
<add binding="basicHttpsBinding" scheme="https"/>
</protocolMapping>-->
<serviceHostingEnvironment aspNetCompatibilityEnabled="false" multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
<directoryBrowse enabled="true"/>
</system.webServer>
</configuration>
Can anyone help to find the cause, or even better point me towards a working sample of WCF over SSL using basicHttpBinding?
I have spent quite a few hours trying to resolve this so will appreciate your time on this one. If you need to I can provide access to my machine.