Solved

HttpHandlers in asp.net

Posted on 2010-11-25
7
487 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
Comment Utility
0
 
LVL 18

Expert Comment

by:Richard Lee
Comment Utility
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
Comment Utility
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
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 

Author Comment

by:Dinesh Kumar
Comment Utility
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
Comment Utility
0
 

Author Comment

by:Dinesh Kumar
Comment Utility
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
Comment Utility
it was more near to the problem faced by me.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

User art_snob (http://www.experts-exchange.com/M_6114203.html) encountered strange behavior of Android Web browser on his Mobile Web site. It took a while to find the true cause. It happens so, that the Android Web browser (at least up to OS ver. 2.…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now