I was surprized that the default Visual Studio 2005 ATL Server Web Service project template does not work as-is on IIS 7 – Windows Server 2008 R2 (x64). I needed to correct the following issues before the hello world example could work:
- The .htm file points to the wrong dll. It is created pointing to <projectname>.dll?Handler=Gen<projectname>WSDL But instead it needs to point to <projectname>Isapi.dll?Handler=Gen<projectname>WSDL
This first error causes initially an HTTP 404.2 error because <projectname>.dll is not in the IIS enable list of ISAPI and CGI Restrictions. Adding that dll would get you beyond the 404.2, but right into a 500.0 0x8007007f “There is a problem with the resource you are looking for, so it cannot be displayed.” because the entry point for Isapi does not exist in the dll. The proper fix is to modify the .htm file to point to the isapi dll.
- The compiled dlls are 32-bit, but .Net Default Application Pool (DefaultAppPool) expects 64-bit. The proper but difficult fix is to change compilation to 64-bit. The quick fix is to edit the advanced settings for DefaultAppPool and change the “Enable 32-Bit Applications” property from False to True. Note that you may not want to change such setting on a production server as it may impact negatively other applications running on the server.
This article was helpful to see all the settings needed for a succesful run:
However you do not need the virtual directory that this article uses. The IIS Application created by VS 2005 works, given that you adjust the setting and fix the .htm file as indicated above.
This said, now that I have these fixes in place, and see the dll entry point being called, I hit a break point in ATL and ultimately get to a new HTTP 500 in IE. So there is yet one or more issues with the project template I have to figure out.