Wcf – Moved the ASP.NET website to IIS 8 on windows server 2012… services missing: .svc files are viewable, but their methods give a 404

asp.nethttp-status-code-404iis-8wcf

I moved from IIS 6 on windows server 2003.

I can browse to the .svc files. I get a nice standard "This is a Windows© Communication Foundation service" page if I go to http://example.com/Service.svc in a browser.

But I can't browse to any of the methods – I get a 404 error if I go to http://example.com/Service.svc/Method?parameter=xyz in a browser.

Has anyone seen anything like this? Any ideas or suggestions?

I thought I might have a similar problem to this question: WCF on IIS8; *.svc handler mapping doesn't work

But the symptoms are different (looks like they can't see .svc files at all) and none of the solutions work (I have Http Activation for WCF features installed, etc).

Best Answer

OK, I gave up and paid Microsoft $250 for support. With the tech's help, we found the solution, and last night confirmed that it was definitely the solution for all our servers: We disabled SSL altogether for WCF services in the web.config:

<system.serviceModel>
    <bindings>
        <webHttpBinding>
            <binding>
                <security mode="Transport" />

The "Transport" refers to Transport Layer Security (TLS is the new SSL) so HTTPS. Changed that to:

<system.serviceModel>
    <bindings>
        <webHttpBinding>
            <binding>
                <security mode="None" />

Turns out WCF is extremely sensitive to whether you are using HTTP or HTTPS, and if you are using the wrong one you get no helpful errors, just 404.

In my case, both old and new servers were configured to use HTTPS at all times for security. But on the new servers, the SSL (TLS) encryption terminated on the load balancer. In that case encryption only happened between the user's browser and our load balancer, and the traffic between our load balancer and the web servers was unencrypted HTTP.

So the service was listening on HTTPS, and when the request came on HTTP, it just completely ignored it.

(All the other talk about similar issues online focused on uninstalling and reinstalling IIS and ASP.NET and WCF and HTTP Activation and such, so I hope this helps someone. I recommend MS Support if you have a question on the MS stack that SO can't answer in time. It was certainly much cheaper than wasting a few more hours trying to fix it alone).

Related Topic