473,804 Members | 2,154 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

asp.net, iis, blocking httphandlers

Hi,
I do that for the first time, but posting this in
microsoft.publi c.dotnet.framew ork.aspnet, microsoft.publi c.inetserver.ii s,
http://forums.asp.net/thread/1271188.aspx (no response) and
http://www.dng.cz/Diskuze/tabid/54/D...=2&dnnbbtid=15 (in
czech, no response) since I found no help and I need solution quite quickly.

I have made a handler built-in in a project, ashx file. I access it using
/MyWeb/MyHandler.ashx/param. It works almost perfectly. The problem is, that
I found from packet anylisis, that some requests are rejected I believe by
IIS (maybe asp.net). All of them are of method OPTIONS, I strongly need to
accept this requests because the handler is DAV-compatible and I need to
acknowledge that in the response.

I do not need any authentication to process OPTIONS.

The returned headers are when using NTLM authentication HTTP/1.1 401
Unauthorized, when using anonymous access 403 Forbidden. :(

For IIS experts - how can I configure the IIS to forward all requests to my
handler?

For asp.net experts - I believe this could be solved by explicitly
registering the handler in web.config. However I can't do that, because I
don't know the type/assembly, since all of the dynamic compilation around.
And I can't compile the handler itself into dll, because it is uising
referencing object and types of the remaining web project.

Thank you all for ANY idea!
Jan Kucera
Apr 30 '06 #1
4 4001
In IIS, in th Home Directory / Configuration tab, you have "applicatio n
extensions" along with whatever HTTP verbs are allowed. Have fun.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jan Kucera" wrote:
Hi,
I do that for the first time, but posting this in
microsoft.publi c.dotnet.framew ork.aspnet, microsoft.publi c.inetserver.ii s,
http://forums.asp.net/thread/1271188.aspx (no response) and
http://www.dng.cz/Diskuze/tabid/54/D...=2&dnnbbtid=15 (in
czech, no response) since I found no help and I need solution quite quickly.

I have made a handler built-in in a project, ashx file. I access it using
/MyWeb/MyHandler.ashx/param. It works almost perfectly. The problem is, that
I found from packet anylisis, that some requests are rejected I believe by
IIS (maybe asp.net). All of them are of method OPTIONS, I strongly need to
accept this requests because the handler is DAV-compatible and I need to
acknowledge that in the response.

I do not need any authentication to process OPTIONS.

The returned headers are when using NTLM authentication HTTP/1.1 401
Unauthorized, when using anonymous access 403 Forbidden. :(

For IIS experts - how can I configure the IIS to forward all requests to my
handler?

For asp.net experts - I believe this could be solved by explicitly
registering the handler in web.config. However I can't do that, because I
don't know the type/assembly, since all of the dynamic compilation around.
And I can't compile the handler itself into dll, because it is uising
referencing object and types of the remaining web project.

Thank you all for ANY idea!
Jan Kucera

Apr 30 '06 #2
Thanks, I've tried to set all verbs to the ashx file however nothing happens
better. In fact without this setting the handler receives all other events
than there were listed, like OPTIONS, LOCK, PROPFIND and so on, however then
connects the application with new session (like Word) and the request is
automatically refused.

If it helps, my handler is beeing accessed as /MyHandler.ashx/GUID
and requests which are refused are to /MyHandler.ashx/

Does this make difference?
Or should I maybe put NTFS Everyone access to the handler file?
Thanks a lot.
"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:25******** *************** ***********@mic rosoft.com...
In IIS, in th Home Directory / Configuration tab, you have "applicatio n
extensions" along with whatever HTTP verbs are allowed. Have fun.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jan Kucera" wrote:
Hi,
I do that for the first time, but posting this in
microsoft.publi c.dotnet.framew ork.aspnet,
microsoft.publi c.inetserver.ii s,
http://forums.asp.net/thread/1271188.aspx (no response) and
http://www.dng.cz/Diskuze/tabid/54/D...=2&dnnbbtid=15
(in
czech, no response) since I found no help and I need solution quite
quickly.

I have made a handler built-in in a project, ashx file. I access it
using
/MyWeb/MyHandler.ashx/param. It works almost perfectly. The problem is,
that
I found from packet anylisis, that some requests are rejected I believe
by
IIS (maybe asp.net). All of them are of method OPTIONS, I strongly need
to
accept this requests because the handler is DAV-compatible and I need to
acknowledge that in the response.

I do not need any authentication to process OPTIONS.

The returned headers are when using NTLM authentication HTTP/1.1 401
Unauthorized, when using anonymous access 403 Forbidden. :(

For IIS experts - how can I configure the IIS to forward all requests to
my
handler?

For asp.net experts - I believe this could be solved by explicitly
registering the handler in web.config. However I can't do that, because I
don't know the type/assembly, since all of the dynamic compilation
around.
And I can't compile the handler itself into dll, because it is uising
referencing object and types of the remaining web project.

Thank you all for ANY idea!
Jan Kucera

May 1 '06 #3
I'm working on a blog entry to answer this question (though I've got tons of
other things to do right now).

In short, you want to extend IIS server functionality with an ASP.Net
Handler, but based on what you have said, your assumptions about HttpHandler
definitely does not match reality so it all looks confusing to you. I agree,
it is our fault, and we are fixing it in IIS7 such that what you want to do
is easy. But, you don't have IIS7 yet, so you will have to understand how
IIS6 AND ASP.Net works to do what you want.

At minimum, you want to at least read the following blog entries to get
context of what you are trying to do:
http://blogs.msdn.com/david.wang/arc...03_Part_2.aspx
http://blogs.msdn.com/david.wang/arc...cs_Part_1.aspx
http://blogs.msdn.com/david.wang/arc...esolution.aspx

WebDAV interaction is a special case for the IIS Request Pipeline. That's
why it's going to get special treatment with its own blog entry.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//

"Jan Kucera" <ua*@centrum.cz > wrote in message
news:%2******** *******@TK2MSFT NGP04.phx.gbl.. .
Thanks, I've tried to set all verbs to the ashx file however nothing
happens better. In fact without this setting the handler receives all
other events than there were listed, like OPTIONS, LOCK, PROPFIND and so
on, however then connects the application with new session (like Word) and
the request is automatically refused.

If it helps, my handler is beeing accessed as /MyHandler.ashx/GUID
and requests which are refused are to /MyHandler.ashx/

Does this make difference?
Or should I maybe put NTFS Everyone access to the handler file?
Thanks a lot.
"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in message
news:25******** *************** ***********@mic rosoft.com...
In IIS, in th Home Directory / Configuration tab, you have "applicatio n
extensions" along with whatever HTTP verbs are allowed. Have fun.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jan Kucera" wrote:
Hi,
I do that for the first time, but posting this in
microsoft.publi c.dotnet.framew ork.aspnet,
microsoft.publi c.inetserver.ii s,
http://forums.asp.net/thread/1271188.aspx (no response) and
http://www.dng.cz/Diskuze/tabid/54/D...=2&dnnbbtid=15
(in
czech, no response) since I found no help and I need solution quite
quickly.

I have made a handler built-in in a project, ashx file. I access it
using
/MyWeb/MyHandler.ashx/param. It works almost perfectly. The problem is,
that
I found from packet anylisis, that some requests are rejected I believe
by
IIS (maybe asp.net). All of them are of method OPTIONS, I strongly need
to
accept this requests because the handler is DAV-compatible and I need to
acknowledge that in the response.

I do not need any authentication to process OPTIONS.

The returned headers are when using NTLM authentication HTTP/1.1 401
Unauthorized, when using anonymous access 403 Forbidden. :(

For IIS experts - how can I configure the IIS to forward all requests
to my
handler?

For asp.net experts - I believe this could be solved by explicitly
registering the handler in web.config. However I can't do that, because
I
don't know the type/assembly, since all of the dynamic compilation
around.
And I can't compile the handler itself into dll, because it is uising
referencing object and types of the remaining web project.

Thank you all for ANY idea!
Jan Kucera


May 3 '06 #4
Hi David,
thank you very much for your answer, it seems I finally found someone who is
able to help me or at least say this can't be done. :)
Well as long as DAV is concerned, actually... this isn't in fact my case, I
think. The IIS doesn't have DAV installed at all and also it doesn't know
that my handler is going to behave as DAV server.
Your articles helped a lot. I also noted that Application_Beg inRequest
doesn't fired at all in cases of the denied requests, so it defnitelly seems
something has gone bad on the IIS side. I also found that DenisV at re:
HOWTO: IIS 6 Request Processing Basics, Part 1 from Tuesday, March 21, 2006
6:13 AM has the same problem.

What I expected is:
http://server/MyApp/Document.ashx/ae...5-1003bda070c1
to do all the DAV stuff like handle OPTIONS, GET and so on on the file
marked with the guid. However, when Word is started from IE, it also queries
(as expected) OPTIONS on the http://server/MyApp/Document.ashx/, which isn't
unfortunately passed to the asp.net at all; thanks to you I think I know why
now.
I used the /guid notation because this is the only method how to preserve
the guid in the request headers by Word, in contrast to ?guid..which was
always thrown away.

So... what you would you suggest me to do?

I was thinking about virtually making the path one level deeper, so when the
Word queries for the parent OPTIONS it will still get to my handler... will
that work?
Eg. to have http://server/MyApp/Documents/DummyLevel/guid and registering
the handler for path "Documents/*". (at the moment I have no registration
since .ashx is properly handled by the IIS)

However if this the way, then the problem is going to the ASP.NET guys, how
to register the handler, since I cannot define the type/assembly because of
the dynamic compliation.

Thank you again David for your help and aswers.
"David Wang [Msft]" <so*****@online .microsoft.com> wrote in message
news:Oo******** ******@TK2MSFTN GP03.phx.gbl...
I'm working on a blog entry to answer this question (though I've got tons
of other things to do right now).

In short, you want to extend IIS server functionality with an ASP.Net
Handler, but based on what you have said, your assumptions about
HttpHandler definitely does not match reality so it all looks confusing to
you. I agree, it is our fault, and we are fixing it in IIS7 such that what
you want to do is easy. But, you don't have IIS7 yet, so you will have to
understand how IIS6 AND ASP.Net works to do what you want.

At minimum, you want to at least read the following blog entries to get
context of what you are trying to do:
http://blogs.msdn.com/david.wang/arc...03_Part_2.aspx
http://blogs.msdn.com/david.wang/arc...cs_Part_1.aspx
http://blogs.msdn.com/david.wang/arc...esolution.aspx

WebDAV interaction is a special case for the IIS Request Pipeline. That's
why it's going to get special treatment with its own blog entry.

--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no
rights.
//

"Jan Kucera" <ua*@centrum.cz > wrote in message
news:%2******** *******@TK2MSFT NGP04.phx.gbl.. .
Thanks, I've tried to set all verbs to the ashx file however nothing
happens better. In fact without this setting the handler receives all
other events than there were listed, like OPTIONS, LOCK, PROPFIND and so
on, however then connects the application with new session (like Word)
and the request is automatically refused.

If it helps, my handler is beeing accessed as /MyHandler.ashx/GUID
and requests which are refused are to /MyHandler.ashx/

Does this make difference?
Or should I maybe put NTFS Everyone access to the handler file?
Thanks a lot.
"Peter Bromberg [C# MVP]" <pb*******@yaho o.nospammin.com > wrote in
message news:25******** *************** ***********@mic rosoft.com...
In IIS, in th Home Directory / Configuration tab, you have "applicatio n
extensions" along with whatever HTTP verbs are allowed. Have fun.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com


"Jan Kucera" wrote:

Hi,
I do that for the first time, but posting this in
microsoft.publi c.dotnet.framew ork.aspnet,
microsoft.publi c.inetserver.ii s,
http://forums.asp.net/thread/1271188.aspx (no response) and
http://www.dng.cz/Diskuze/tabid/54/D...=2&dnnbbtid=15
(in
czech, no response) since I found no help and I need solution quite
quickly.

I have made a handler built-in in a project, ashx file. I access it
using
/MyWeb/MyHandler.ashx/param. It works almost perfectly. The problem is,
that
I found from packet anylisis, that some requests are rejected I believe
by
IIS (maybe asp.net). All of them are of method OPTIONS, I strongly need
to
accept this requests because the handler is DAV-compatible and I need
to
acknowledge that in the response.

I do not need any authentication to process OPTIONS.

The returned headers are when using NTLM authentication HTTP/1.1 401
Unauthorized, when using anonymous access 403 Forbidden. :(

For IIS experts - how can I configure the IIS to forward all requests
to my
handler?

For asp.net experts - I believe this could be solved by explicitly
registering the handler in web.config. However I can't do that, because
I
don't know the type/assembly, since all of the dynamic compilation
around.
And I can't compile the handler itself into dll, because it is uising
referencing object and types of the remaining web project.

Thank you all for ANY idea!
Jan Kucera



May 3 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1725
by: some guy with a computer | last post by:
I can not get a custom httpHandler to fire using machine.config and an assembly in the GAC. It will not work if I move the assembly to the GAC, even though I have it referenced correctly and add the assembly to the <compile> tag (all my other controls I can call from the GAC this way). It will not work if I have the handler specified where the rest are (*.cs, *.aspx.....etc, in machine.config)
2
1541
by: Luis | last post by:
Hi, I want to protected all files in my website, so I try to use httpHandlers, I put this in my WEB.CONFIG (at the end of page), but I can't protected the files type MDB, CSB, can someone help me? : <httpHandlers> <add verb="*" path="*.mdb" type="System.Web.HttpForbiddenHandler" /> <add verb="*" path="*.csv" type="System.Web.HttpForbiddenHandler" />
0
1264
by: Chance Hopkins | last post by:
Does anyone know how to get a custom httpHandler to fire for all applications in machine.config for an assembly in the GAC, without using seperate location tags? For instance, this works for a single domain: <location path="mydomain.com" allowOverride="false" > <system.web> <httpHandlers> <add verb="*" path="*.mycustomExtension" type="MyCustomClass,MyDLL, Version=1.0.0.0, Culture=neutral, PublicKeyToken=47922ba823051f3f, Custom=null"...
1
1315
by: Patrick Kristiansen | last post by:
Hi! I have on my website a root web.config file, and also created a subapplication "/publikationer". In my root web.config I've specified an HTTP-handler for some requests, but this is mirrored in my subapplication. Eventhough I <clear /> my HTTP-handlers it doesn't seem to work, and it still gives me an error about an assembly not found. It should not use this certain HTTP-handler in my subapplication.
1
2278
by: TJoker .NET | last post by:
I have this web control that need to process some special urls requested by the browser. So I created a class implementing IHttpHandler to deal with it. The problem here is that to properly use the control, the developer has to include something like the following in his web.config: <httpHandlers> <add verb="*" path="MySpecialResource.ashx" type="MyRequestHandler, MyAssembly"/>
4
3345
by: Grant Harmeyer | last post by:
How would I set up an httpHandler so that it would only apply to certain child directories of the application? I.E: <httpHandlers> <add verb="*" path="/files/*/*/*/*.aspx" type="App.HttpHandlers.ThreeDeepPage, App" /> <add verb="*" path="/files/*/*/*.aspx" type="App.HttpHandlers.TwoDeepPage, App" /> </httpHandlers>
3
2129
by: MWells | last post by:
I'm having an issue getting my HttpHandlers and HttpModules to play together nicely. My HttpHandlers take special document types (defined by extension) and process them specially. I might have an HttpHandler installed to render Excel files as HTML, or to render TIFFs to JPEGs, etc. The HttpModules are used for Uri handling, so that a request for a resource like;
2
1352
by: David | last post by:
I am installing apps on an asp.net 1.1 machine to which I have no access to the IIS configuration. I need to lock out the viewing of files types in a directory. As per info on the net, I added the following in the web.config. However, when I directly address the files via. www.testsite.com/test.logs, the system shows the file. Is there other option I need to add to the config or is this an issue with the way that IIS was installed on...
0
1173
by: tshad | last post by:
I have 2 controls that I need to run that I got of the Web. I have been using ScrollKeeper for awhile and was trying to add FreeTextBox to my site. But for some reason it won't run if ScrollKeeper is there. Here is my Web.Config file: <configuration> <system.web> <customErrors mode="Off" /> <httpModules>
5
2024
by: Anonieko | last post by:
HttpHandlers - Learn Them. Use Them. Introduction There are many features in ASP.NET that are unfortunately underused. Sometimes a feature gets looked over because it's too complicated. Other times, like in the case of HttpHandlers, it's because they are poorly understood. For the longest time I understood the concept and
0
9594
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10343
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10341
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10089
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6862
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5530
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5673
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3831
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3001
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.