Solved

HttpHandlers in asp.net

Posted on 2010-11-25
7
491 Views
Last Modified: 2012-05-10
How can we configure HTTPHandler in IIS (preferably 6 version)  which will invoke when any request to the employee object goes?

I can do it in web.config like <add type="RestWebService.Service, RestWebService" verb="*" path="employee" />

but the handler is not getting invoked.
0
Comment
Question by:Dinesh Kumar
  • 5
7 Comments
 
LVL 12

Accepted Solution

by:
jagssidurala earned 250 total points
ID: 34213506
0
 
LVL 18

Expert Comment

by:Richard Lee
ID: 34213525
I am not entirely clear on what you are asking for however:

1. To deploy and HTTP handler on II6 you can do the following:
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/784eeb32-d781-4917-95b3-34f302a81680.mspx?mfr=true

2. The nature of a handler means that it is called when a request matching the supplied verb comes into the website. This is key to understanding if it can achieve what you want.

If you have a static employee object then you could have each request access this object and do some sort of processing.

Application Domain
----------------------------          HttpHandler           Requests
-                          -                                 <---------------------
-   Static Object    -  <-------- HD <---------   <---------------------
-                          -                                 <---------------------
----------------------------

Forgive the poor excuse for a diagram, but here we have three requests coming into the website and each running the reusable HttpHandler which in turn accesses the static object. As you can see here you have encountered the realm of multi-threading even though you have created the threads yourself. This means that you may need to control access to the static object not to invalidate its state.

Okay having said all of that what does this mean, "request to the employee object"?

Hope this helps

DaTribe
0
 

Author Comment

by:Dinesh Kumar
ID: 34215687
if I say "request to the employee object" it means suppose i want to see the details of an employee then I will make request to the http://localhost/RestWebService/employee?id=3550 where  RestWebService is the virtual directory.

what is difference b/w default website and any virtual directory made in it.

 If i change the application mapping to .* then all request to the IIS should go to the httphandler first. that means it should invoke the handler first where I have defined what code is to execute to generate the response when the employee object is invoked.
please see the attachement where the employee object is.

Moreover please refer the deployment on which i am working
http://www.codeproject.com/KB/webservices/RestWebService.aspx
you would like to see Part # 5 - Deploying the application of this url.

As far as IIS is concerned, FYI I am working at IIS as screen shot is attached.
 .employee does not make sense because i will hit the url as
http://localhost/RestWebServiceemployee?id=3550

and employee is not a file extension its an object!
employee-object.JPG
iis-screen-shot.JPG
0
ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

 

Author Comment

by:Dinesh Kumar
ID: 34217269
From the link provided by jagssidurala i.e http://neilkilbride.blogspot.com/2008/03/httphandler-for-all-requests-in-aspnet.html
proved useful in resolving the issue.

Thanks
0
 

Assisted Solution

by:Dinesh Kumar
Dinesh Kumar earned 0 total points
ID: 34217275
0
 

Author Comment

by:Dinesh Kumar
ID: 34222933
I also do thanks to the DaTribe for his explanation. I really like the diagram drawn by him.
0
 

Author Closing Comment

by:Dinesh Kumar
ID: 34246248
it was more near to the problem faced by me.
0

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

770 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question