Hi Friends,
I have a WCF-Service configured with two endpoints using wsHttpBinding, one for http and the other for https. They use the same address, the endpoints just differ by the used protocol:
<services>
<service name="Test.ClientService">
<endpoint binding="wsHttpBinding" bindingConfiguration="wsBindingConfig" behaviorConfiguration="wsBehaviour" contract="Test.Contracts.IClientService"/>
<endpoint binding="wsHttpBinding" bindingConfiguration="sslWsBindingConfig" behaviorConfiguration="wsBehaviour" contract="Test.Contracts.IClientService"/> </service>
<services>
using the following behaviours and bindings:
<behaviors>
<endpointBehaviors>
<behavior name="wsBehaviour">
<webHttp/>
</behavior>
</endpointBehaviors>
</behaviors>
<bindings>
<webHttpBinding>
<binding name="wsBindingConfig">
<security mode="None"/>
</binding>
<binding name="sslWsBindingConfig">
<security mode="Transport"/>
</binding>
</webHttpBinding>
</bindings>
Both endpoints works fine when I have the certificate installed on IIS 6.
When the certificate is not installed in the IIS, the HTTPS-Endpoint certainly won't work. But the HTTP-Endpoint also doesn't work.
It fails with an exception: when I access the service with http://localhost:5034/Test/ClientService.svc
The exception is as below:
Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http].
which is irritating because I didn't request an HTTPS-URL.
Now when I split the service into two, the HTTP-Access also works on the IIS on which the SSL-Certificate is not installed:
<services>
<service name="Test.ClientServicee"> <endpoint binding="wsHttpBinding" bindingConfiguration="wsBindingConfig" behaviorConfiguration="webBehaviour" contract="Test.Contracts.IClientService"/>
</service>
<service name="Test.ClientService">
<endpoint binding="wsHttpBinding" bindingConfiguration="sslWsBindingConfig" behaviorConfiguration="webBehaviour" contract="Test.Contracts.IClientService"/>
</service>
</services>
The problem now is that the client has to use two different endpoints instead of just changing the protocol. We have a system where the customer can turn on SSL via our Configuration-Tool depending on their security needs. But I don't want to force them to change the web.config of the WCF-Service.I want to access both endpoints protocol http or https simultaneously.Please can anyone guide me how to do.
Thanks ,
Krishna.K
Reply |
Reply with attachment |
Alert Moderator