IIS 7 WCF Webservices giving 404 error over HTTPS
I have some WCF webservices running under IIS 7.5 which are responding correctly to http requests but respond with 404 (Not Found) errors when methods are called using SSL.
The binds for the site are as below:
When calling http://127.0.0.1:8088/Public/PublicDataService.svc I get the expected response:
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax: etc
And likewise calling any of the Service methods works, there is a most basic method called CanConnect which simply returns "true"
http://127.0.0.1:8088/Public/PublicDataService.svc/CanConnect
true
When using https the following is the result.
https://127.0.0.1/Public/PublicDataService.svc
You have created a service.
To test this service, you will need to create a client and use it to call the service. You can do this using the svcutil.exe tool from the command line with the following syntax:
https://127.0.0.1/Public/PublicDataService.svc/CanConnect
Server Error in '/Public' Application.
The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.
Requested URL: /Public/PublicDataService.svc/CanConnect
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1055.0
This has me entirely stumped, how can calls the .svc work but its internal methods give 404? To make matters even more confusing this was working... in fact I'm not even sure when it stopped, ie If it corresponds to a code release or server patches etc.
The actual config of the website is thus:
Webservices (this is the root of the application / where the Web.Config sits)
- Public (a windows directory, no addition config)
There are a number of other services that run directly under the root that are functioning fine both under http and https.
Any ideas as to what might be causing this.
It turns out that it was simply an error in the web.config file.
These two answers on SO were the solution:
https://stackoverflow.com/a/26581326/1286358
And the reverse
https://stackoverflow.com/a/26539003/1286358
Strange that it was working on both http and https once and then just stopped.... there must have been some other configuration changes elsewhere..
EDIT: Actual fix for completeness
The following was in the web.config was changed from "none" to "Transport"
<system.serviceModel>
<bindings>
<webHttpBinding>
<binding>
<security mode="Transport" />