I created a wcf Rest service using net framework 4 and IIS 6. I use route table in global asa . It's working fine in my computer . When I Install it in Qa the service is not working.
When requesting the service I receive 404 error.
The problem is that ISAPI filter of IIS cannot map between the request and the code.
Created separate pool for IIS application. Please advice.
Web config
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
<trust level="Full" originUrl="" />
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</modules>
</system.webServer>
<system.serviceModel>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"/>
<standardEndpoints>
<webHttpEndpoint>
<standardEndpoint name="" helpEnabled="true" automaticFormatSelectionEnabled="true"/>
</webHttpEndpoint>
</standardEndpoints>
</system.serviceModel>
</configuration>
Global.asa
void Application_Start(object sender, EventArgs e)
{
Regi开发者_开发百科sterRoutes();
}
private void RegisterRoutes()
{
WebServiceHostFactory factory = new WebServiceHostFactory();
RouteTable.Routes.Add(new ServiceRoute("Data", factory, typeof(DataHandler)));
RouteTable.Routes.Add(new ServiceRoute("UserData", factory, typeof(UserData)));
RouteTable.Routes.Add(new ServiceRoute("SetupData", factory, typeof(SetupData)));
}
If you're going to use routing with IIS 6, there's some special considerations that need to be made for routing. Here is an article that walks through them. If you haven't taken care of these things, you're going to get 404s when you try to use your routes.
精彩评论