0

I have a website which contains one WCF service. I dont have separate WCF Project for that. when working locally it works fine. Now I want to host that website in IIS It is showing 404 (Not Found)

http://arapl-ws-08/ARAPLWeb/wcf/ExposureService.svc/InitializeGrid 404 (Not Found)

this is the folder structure after hosting website enter image description here

in web.config I have mentioned service model like this

<system.serviceModel>
    <bindings>
      <webHttpBinding>
        <binding name="WebHttpEndpointBinding">
          <security mode="TransportCredentialOnly">
            <transport clientCredentialType="Windows" proxyCredentialType="Windows" />
            <!--<transport clientCredentialType="Windows"  />-->
          </security>
        </binding>
      </webHttpBinding>
    </bindings>

    <behaviors>
      <endpointBehaviors>
        <behavior name="ARAPL">
          <endpointDiscovery enabled="false" />
          <enableWebScript />
        </behavior>
      </endpointBehaviors>

      <serviceBehaviors>
        <behavior name="WCFWindowsBasicHttpBinding.Service1Behavior">
          <serviceMetadata httpGetEnabled="true" httpsGetEnabled="false" />
          <serviceAuthenticationManager authenticationSchemes="Negotiate" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <services>

      <service name="RiskAnalytics.Web.wcf.ExposureService" behaviorConfiguration="WCFWindowsBasicHttpBinding.Service1Behavior">
        <endpoint address="" name="webHttpEndpoint" binding="webHttpBinding" bindingConfiguration="WebHttpEndpointBinding" behaviorConfiguration="ARAPL" contract="RiskAnalytics.Web.wcf.IExposureService">
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
      </service>

    </services>
  </system.serviceModel>
Ameya Deshpande
  • 3,580
  • 4
  • 30
  • 46
  • sounds like an IIS config issue. take a look at this question and see if anything helps. http://stackoverflow.com/questions/2609377/http-404-when-accessing-svc-file-in-iis – Jay Oct 08 '15 at 07:09
  • @Jay thanks will look into it – Ameya Deshpande Oct 08 '15 at 07:09
  • Did you try "http://arapl-ws-08/ARAPLWeb/wcf/ExposureService.svc" in browser (omitting operation name)?? – Viru Oct 08 '15 at 07:12
  • @Viru yes it is saying 404 - File or directory not found. The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable. – Ameya Deshpande Oct 08 '15 at 07:13
  • WCF 4 needs to be manually registered on IIS if on Windows 7 or Server 2008 R2. – Lex Li Oct 08 '15 at 07:27
  • @Jay http://stackoverflow.com/questions/2609377/http-404-when-accessing-svc-file-in-iis this solved my problem .. answer given by Aaron D. – Ameya Deshpande Oct 08 '15 at 07:37

1 Answers1

0

this solved my problem. In fusture if anyone got an issue refer this

I found these instructions on a blog post that indicated this step, which worked for me (Windows 8, 64-bit):

Make sure that in windows features, you have both WCF options under .Net framework are ticked.

So go to Control Panel –> Programs and Features –> Turn Windows Features ON/Off –> Features –> Add Features –> .NET Framework X.X Features. Make sure that .Net framework says it is installed, and make sure that the WCF Activation node underneath it is selected (checkbox ticked) and both options under WCF Activation are also checked.

These are:

* HTTP Activation
* Non-HTTP Activation

Both options need to be selected (checked box ticked).

Ameya Deshpande
  • 3,580
  • 4
  • 30
  • 46