How to make WCF service work over SSL?

I am running the C # web service in IIS6 and trying to get it to work through SSL. When running tcpdump, it shows the initial call as https, but every other call through http. My SSL certificate is signed by itself, and https works fine in my web browser. I am using PHP SoapClient for the client.

Does anyone know what might cause this?

In wsdl, the address location is set to http. Should it be https? How to change it?

<wsdl:service name="Service"> <wsdl:port name="BasicHttpBinding_Service" binding="i0:BasicHttpBinding_Service"> <soap:address location="http://example.com/Service.svc"/> </wsdl:port> </wsdl:service> 
+7
source share
1 answer

You must configure the service to use HTTPS:

 <bindings> <basicHttpBinding> <binding name="https"> <security mode="Transport" /> </binding> </basicHttpBinding> </bindings> <behaviors> <serviceBehaviors> <behavior name="metadata"> <serviceMetadata httpsGetEnabled="true" /> </behavior> </serviceBehaviors> </behaviors> <services> <service name="..." behaviorConfiguration="metadata"> <endpoint address="..." contract="..." binding="basicHttpBinding" bindingConfiguration="https" /> </service> </services> 

This will only allow your service to be called over HTTPS, because there is no unsecured endpoint. WSDL will also be available only through HTTPS, as HTTP GET is not enabled.

+10
source

All Articles