Here is my config settings, which currently only allows HTTP:
<system.serviceModel>
<services>
<service name="MyAjaxSvc">
<endpoint address="" behaviorConfiguration="MyAjaxSvcEndpointBehavior"
binding="webHttpBinding"
contract="MyAjaxSvc" />
</service>
</services>
<behaviors>
<endpointBehaviors>
<behavior name="MyAjaxSvcEndpointBehavior">
<enableWebScript />
</behavior>
</endpointBehaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
This service could potentially be called on any page on my website. Some pages are HTTPS, so I would like to set it up so that the service can be called (AJAX) using either protocol. Ideally, I would like all my AJAX service calls to be HTTPS, but since you can’t mix protocols, I will settle for allowing the service to be called using what ever protocol the current page is using.
Shot in the dark:
You’ll need to add another Binding (declared above the code you show (normally)), and then declare another endpoint.