The above works if you don't need HTTP and HTTPS. In my case, I want both because some services require SSL (authentication), while others are not like the information they provide is not sensitive. The authentication service implementation checks and refuses to respond if the request is not received from the https scheme.
The following configuration works if you want to configure both HTTP and HTTPS on the same endpoint.
<system.serviceModel> <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" /> <behaviors> <serviceBehaviors> <behavior name=""> <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" /> </behavior> </serviceBehaviors> </behaviors> <bindings> <webHttpBinding> <binding> <security mode="Transport" /> </binding> <binding name="UnsecureBinding"></binding> </webHttpBinding> </bindings> <protocolMapping> <add scheme="http" binding="webHttpBinding" bindingConfiguration="UnsecureBinding" /> </protocolMapping> <standardEndpoints> <webHttpEndpoint> <standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="false" /> </webHttpEndpoint> </standardEndpoints> </system.serviceModel>
Goncalo oliveira
source share