asp.net, iis, blocking httphandlers

J

Jan Kucera

Hi,
I do that for the first time, but posting this in
microsoft.public.dotnet.framework.aspnet, microsoft.public.inetserver.iis,
http://forums.asp.net/thread/1271188.aspx (no response) and
http://www.dng.cz/Diskuze/tabid/54/Default.aspx?dnnbbfid=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
 
G

Guest

In IIS, in th Home Directory / Configuration tab, you have "application
extensions" along with whatever HTTP verbs are allowed. Have fun.
Peter
 
J

Jan Kucera

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.
 
D

David Wang [Msft]

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/ar..._from_IIS6_on_Windows_Server_2003_Part_2.aspx
http://blogs.msdn.com/david.wang/ar...O_IIS_6_Request_Processing_Basics_Part_1.aspx
http://blogs.msdn.com/david.wang/ar..._can_disable_Default_Document_resolution.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.
//
 
J

Jan Kucera

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_BeginRequest
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/ae9a95fa-fcd9-47fc-bdd5-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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,236
Members
46,822
Latest member
israfaceZa

Latest Threads

Top