0

I have a wcf service hosted in the web application and when we try to hit the service using http it works fine, but when we hit it under https it gives 404 not found, how do I enable WCF service under https to allow ajax get calls? IF thats the issue...

here is the configuration :

  <webHttpBinding>
    <binding name="secure" maxBufferSize="655360" maxBufferPoolSize="5242880" maxReceivedMessageSize="655360">
      <readerQuotas maxDepth="32" maxStringContentLength="655360" maxArrayLength="655360" maxBytesPerRead="4096" maxNameTableCharCount="16384"/>
      <security mode="None"/>
    </binding>
  </webHttpBinding>
</bindings>
<services>
  <service name="CampWareMobileServices.HousekeepingMobileService" behaviorConfiguration="ServiceBehavior">
    <clear/>
    <endpoint address="" binding="webHttpBinding" behaviorConfiguration="webBehavior" contract="CampWareMobileServices.IHousekeepingMobileService" />

  </service>
</services>
<behaviors>
  <endpointBehaviors>
    <behavior name="webBehavior">
      <webHttp/>
    </behavior>
  </endpointBehaviors>
  <serviceBehaviors>
    <behavior name="ServiceBehavior">
      <serviceMetadata httpGetEnabled="True" httpsGetEnabled="true"/>

      <serviceDebug includeExceptionDetailInFaults="false"/>
    </behavior>
  </serviceBehaviors>
</behaviors>
user2612665
  • 91
  • 1
  • 2
  • 11
  • There is way too much information missing to assist here. Are using using IIS? Have you set up an HTTPS binding on your IIS server? – vcsjones Apr 09 '15 at 16:20
  • Hi, thnx for quick response, and yes it is setup in IIS and HTTPS binding is setup – user2612665 Apr 09 '15 at 16:28

1 Answers1

0

You need to have 2 different endpoint and binding, like following. I have already answered similar question here - WCF service not working when accessed over HTTPS and HTTP

<system.serviceModel>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
  <bindings>
    <webHttpBinding>
      <binding name="Binding" crossDomainScriptAccessEnabled="true">
        <security mode="Transport">
          <transport clientCredentialType="None" />
        </security>
      </binding>
      <binding name="httpbind" crossDomainScriptAccessEnabled="true">
      </binding>
    </webHttpBinding>
  </bindings>
  <client />
  <services>
    <service name="RestService.service"  behaviorConfiguration="ServiceBehaviour">
      <endpoint address="" binding="webHttpBinding" bindingConfiguration="Binding" contract="RestService.Iservice" behaviorConfiguration="web">
      </endpoint>
      <endpoint address="" binding="webHttpBinding" bindingConfiguration="httpbind" contract="RestService.Iservice" behaviorConfiguration="web">
      </endpoint>
    </service>
  </services>
  <behaviors>
    <serviceBehaviors>
      <behavior name="ServiceBehaviour">
        <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
      <behavior name="web">
        <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="true" />
      </behavior>
    </serviceBehaviors>
    <endpointBehaviors>
      <behavior name="web">
        <webHttp helpEnabled="true" />
      </behavior>
    </endpointBehaviors>
  </behaviors>
</system.serviceModel>
Community
  • 1
  • 1
Arindam Nayak
  • 7,346
  • 4
  • 32
  • 48