views:

937

answers:

2

What are the configuration file settings to enable webservices on IIS 7.0 in classic mode? The site has to be in a classic mode application pool because the Report Viewer controls crash when running in Integrated Mode. However in a classic mode application pool, webservices produce the following error message:

The requested content appears to be script and will not be served by the static file handler.

•If you want to serve this content as a static file, add an explicit MIME map

EDIT - Additional Error Message Info:

  1. HTTP Error 404.17 - Not Found
  2. Module: StaticFileModule
  3. Notification: ExecuteRequestHandler
  4. Handler: StaticFile
  5. Error Code: 0x80070032

Note: This particular instance of the application will be running in a customers account on a shared hosting enviroment so access to IIS UI is not/will not be available. Specifically seeking configuration file adjustments.

A: 

In IIS Manager (Start -> Run -> inetmgr), select the website or virtual directory you want to set to classic mode.

In the right hand panel "Actions", click on "Basic Settings".

Next to application pool (that is defaulted to DefaultAppPool), click "Select" and change it to "Classic .Net AppPool".

Walkthrough is here.

Update: Sorry, I misread your question. There are a couple of things you can try:

The first is to double check the IIS installation features from the control panel (Programs and Features -> Turn Windows Features on and off -> Internet Information Services -> World Wide Web Services -> Application Development Features). I have everything bar CGI and Server-side includes checked).

Secondly, make sure that your site is correctly setup as an application (select website -> Actions -> View Applications). If it isn't there you'll need to add it.

Third thing to check is specifically the Handlers, which is accessed through IIS Manager -> Select website -> Handler Mappings -> Open Feature -> Make sure .asmx is there. I have it three times, WebServiceHandlerFactory-Integrated (handler System.Web.Handlers.WebAdminHandler), WebServiceHandlerFactory-ISAPI-2.0 (Isapi Module), and WebServiceHandlerFactory-ISAPI-2.0-64 (Isapi Module).

Finally you make sure you are using the correct .NET version for that application.

Again, apologies for the original duff answer.

Junto
Hi, As per the question, the server is already in classic mode - this is what is causing the issue. The question is not how to put IIS7 into classic mode but rather what configuration settings are required to enable web services for an IIS 7 server already in classic mode.
intermension
Added some comments above...
Junto
Hi, Yes its definitely a handlers issue. Web services need to routed to something other than the static file handler. I cant say I ever had the need to manually adjust the settings though so Im not sure which gets mapped to what. I will have another tinker now (that Ive had some sleep) using the info you have provided.
intermension
A: 

This sounds like your HandlerMappings are a bit screwy. You can revert to known good a baseline (provided you haven't tinkered with the server wide Handler Mappings) by doing:

  1. Open IIS Manager
  2. Open the site in question
  3. In the Features View for the site open the Handler Mappings feature
  4. In the Actions pane (top right), click on "Revert To Parent"
Kev
Yes. Sure does. Unfortunately I don't have access to IIS Manager. The app will be run in a shared environment. Everything is fine on the test server IIS7.0 so my thoughts are that something is different in the machine.config file on the hosted server so i need to explicitly set or overwrite something in web.config for this application.
intermension