Issue in Custom HttpHandler in IIS 7

Posted by Umaquiet under IIS on 12/8/2010 | Points: 10 | Views : 2003 | Status : [Member] | Replies : 1
I am working using custom IHttpHandler in my application. It is working fine in IIS 5. But now we are migrating to IIS 7 so we bought 2008 R2 server. Here it is not working. Kindly Help. you can reach me in maheswaran@lucidindia.com. Thanks in advance.

This is my web.config content:


<configuration>
<appSettings>
<add key="ChartHttpHandler" value="Storage=memory;Timeout=180;Url=~/temp/;"/>
</appSettings>
<connectionStrings/>
<system.web>
<profile>
<properties>
<add name="searchSettings" defaultValue="" type="System.String"/>
</properties>
</profile>
<sessionState timeout="2">
</sessionState>
<compilation debug="true" targetFramework="4.0">
<assemblies>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation>

<authentication mode="Windows"/>

<httpHandlers>
<add verb="GET,POST" path="*.lst" type="App_Code.WebRequestHandler"/>
</httpHandlers>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/></system.web>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="WebRequests" verb="*" path="*.lst" modules="IsapiModule" scriptProcessor="%path%\aspnet_isapi.dll" type="App_Code.WebRequestHandler"/>
</handlers>
</system.webServer>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
</serviceBehaviors>
</behaviors>
<services>
</services>
</system.serviceModel>
</configuration>

This is my Custom Handler Code :


public class WebRequestHandler : IHttpHandler, IRequiresSessionState
{
private void ProcessDataRequest(HttpContext context)
{
Controller controller = new Controller();
controller.ProcessDataRequest(context);
}

#region IHttpHandler Members

public bool IsReusable
{
get { return true; }
}

public void ProcessRequest(HttpContext context)
{
var segments = context.Request.Url.Segments;
var request = segments[segments.Length - 1];

context.Response.Expires = -1;

switch (request)
{
case "data.lst":
this.ProcessDataRequest(context);
return;
}
}

#endregion
}




Responses

Posted by: Umaquiet on: 12/8/2010 [Member] Starter | Points: 25

Up
0
Down
And i am calling like this.

this.client = new WebClient();
this.client.DownloadProgressChanged += this.OnProgressChanged;
this.client.OpenReadCompleted += this.OnDataAvailable;
this.client.OpenReadAsync(new Uri("../data.lst?viewerID=viewer", UriKind.Relative), "GET");

But the ProcessRequest(HttpContext context) method is not called in IIS 7 .

Umaquiet, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response