views:

376

answers:

1

We are using AJAX Cascading dropdown and AutoComplete functionality with Restful WebService Services providing data. With one endpoint(non-secured) eveything was working fine, until we tried same web page with https. Our Webappplication needs to support both. Our of very few articiles/blogs on this issue I found 2 which applies to my requirements.

  1. http://blog.abstractlabs.net/2009/02/ajax-wcf-services-and-httphttps.html
  2. http://www.mydotnetworld.com/post/2008/10/18/Use-a-WCF-Service-with-HTTP-and-HTTPS-in-C.aspx

I followed same pattern, added 2 endpoints, assuming WCF will pickup appropriate endpoint looking at HTTP or HTTPS protocol. Worked like a charm in my dev machine(XP-IIS5) and 1 Server 2003R2(IIS6), however did work in Production server 2003-IIS6. Website in IIS is exact same(including permission etc). The error it throws - Error 500(Could not find a base address that matches scheme https for the endpoint with binding WebHttpBinding. Registered base address schemes are [http]..)

Here's the sample configuration(ignore typos)

<system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="SecureBinding">
          <security mode="Transport"/>
        </binding>
      </webHttpBinding>
    </bindings>
    <behaviors>
      <endpointBehaviors>
        <behavior name="SearchServiceAspNetAjaxBehavior">
          <enableWebScript />
        </behavior>
      </endpointBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" />
    <services>
      <service name="SearchService">
        <endpoint address="" behaviorConfiguration="SearchServiceAspNetAjaxBehavior"
            binding="webHttpBinding" contract="SearchServiceContract" />
       <endpoint address="" behaviorConfiguration="SearchServiceAspNetAjaxBehavior"
            binding="webHttpBinding" bindingConfiguration="SecureBinding" contract="SearchServiceContract" />
      </service>
    </services>
  </system.serviceModel>

Any help on this is highly appreciated ?

Thanks KSS

A: 

I'm using almost the same configuration in my service, though my endpoint behavior references <webHttp /> instead of <enableWebScript />. You mentioned your servers are the same, but in any case, have you tried testing SSL traffic elsewhere on the affected server?

JoeGaggler
Thanks for responding. I haven't used <webHttp /> yet, you think it can make difference ? I will try it anyways today. Affected server's SSL traffic looks good for other functionality.Otherwise, does anyone see any issue with the approach ?Is it possible to have your Rest Webservice(webhhtpbinding) work for both http and https at same time with help of some WCF configuration only ? Or I have to do it programmatically(something like figure out whether call is http or https and use appropriate binding) ?
KSS