?
Solved

HttpHandlers in asp.net

Posted on 2010-11-25
7
Medium Priority
?
495 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 1000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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

Technology Partners: 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!

Question has a verified solution.

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

While working on Silverlight and WCF application, I faced one issue where fault exception occurred at WCF operation contract is not getting propagated to Silverlight client. So after searching net I came to know that it was behavior by default for s…
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.…
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses
Course of the Month10 days, 8 hours left to enroll

765 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