Solved

HttpHandlers in asp.net

Posted on 2010-11-25
7
494 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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

Enroll in June's Course of the Month

June’s Course of the Month is now available! Experts Exchange’s Premium Members, Team Accounts, and Qualified Experts have access to a complimentary course each month as part of their membership—an extra way to sharpen your skills and increase training.

Question has a verified solution.

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

A quick way to get a menu to work on our website, is using the Menu control and assign it to a web.sitemap using SiteMapDataSource. Example of web.sitemap file: (CODE) Sample code to add to the page menu: (CODE) Running the application, we wi…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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