Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Getting HTTPS to work when using basicHttpBinding

I am using WCF4 and having troubles getting a service to work over https

I have create a wcf service and deployed to server and it is working ok over http. As soon as I change the web.config endpoint address to be https I get an error

Service 'NS.WebWCF.BusinessV1' has zero application (non-infrastructure) endpoints. This might be because no configuration file was found for your application, or because no service element matching the service name could be found in the configuration file, or because no endpoints were defined in the service element.

My web.config looks like

 <services>
  <service name="NS.WebWCF.Business_v1">
    <endpoint address="https://mydomain.com/business/v1/BusinessV1.svc" binding="basicHttpBinding" bindingConfiguration="" contract="NS.WebWCF.IBusinessV1" listenUri="/" isSystemEndpoint="true">
     </endpoint>
  </service>

I have set my IIS to require SSL. However I get the above error.

What do I need to do to get https to work?

like image 254
Diver Dan Avatar asked May 23 '11 03:05

Diver Dan


People also ask

What is the difference between Webhttpbinding and BasicHttpBinding?

Primarily BasicHttpBinding is designed to exchange SOAP over HTTP(s) only, just like old ASMX or . net web services and supports the WS-I BasicProfile. WsHttpBinding supports the advanced WS-* specification which includes WS-Addressing and WS-Security etc.

What is HTTP binding in WCF?

BasicHttpBinding is suitable for communicating with ASP.NET Web Service (ASMX) based services that conform to the WS-Basic Profile that conforms with Web Services. This binding uses HTTP as the transport and text/XML as the default message encoding. Security is disabled by default.


1 Answers

Try this one:

<system.serviceModel>
  <bindings >

    <webHttpBinding>
      <binding name="webBinding">
        <security mode="Transport">
        </security>
      </binding>
    </webHttpBinding>

  </bindings>

  <services>
    <service ...>
      <endpoint bindingConfiguration="webBinding" .../>
    </service>
  </services>

</system.serviceModel>
like image 76
Anton Levshunov Avatar answered Sep 27 '22 23:09

Anton Levshunov