Hi,
May be this question is asked numerous times before, but since I could not get it my problem solved, hence posting this question.
Well my requirement is simple, I need to run my service under https. I created a normal WCF service which returns the current date and time along with the string passed.
It works pretty well when i view the Service.svc file over a browser under http.
I did some changes to my web.config in order to make the service compatible for https and also created a certificate in my local IIS.
Below is my web.config file
<system.serviceModel>
<services>
<service name="Service" behaviorConfiguration="ServiceBehavior">
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="customHttp" contract="IService">
<identity>
<dns value="localhost"/>
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpsBinding" contract="IMetadataExchange"/>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="ServiceBehavior">
<serviceMetadata httpsGetEnabled="true"/>
<serviceDebug includeExceptionDetailInFaults="false"/>
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<wsHttpBinding>
<binding name="customHttp">
<security mode="Transport">
<transport clientCredentialType="None"/>
</security>
</binding>
</wsHttpBinding>
</bindings>
I have created a new wsHttpBinding binding with security mode as transport and attached the binding configuration to the preferred endpoint.
When I try to browse the service.svc file in the browser, it says:
Could not find a base address that matches scheme https for the endpoint with binding WSHttpBinding. Registered base address schemes are [http].
I gave the service URL in the address portion of the endpoint as 'http://[localhost:54110]/samplewcf/Service.svc', then I started getting the error as:
Could not find a base address that matches scheme https for the endpoint with binding MetadataExchangeHttpsBinding. Registered base address schemes are [http].
I tried to change the wsHttpBinding to basicHttpBinding and webHttpBinding, but it doesn't work. I get the above errors.
Since I manually created a certificate using Server Certificates in IIS, i am able to browse localhost over https, but my service does not run under https. I went throught numerous posts in Stack Overflow and many blogs too, but couldn't find the resolution.
Experts kindly assist me. Any pointers would be highly appreciated.
Regards
Anurag