Welcome to HostingForumz.com!
FAQFAQ   SearchSearch      ProfileProfile    Private MessagesPrivate Messages   Log in/Register/PasswordLog in/Register/Password

ISAPI filter to post-process requests

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Related Topics:
Reading POST data from an ISAPI filter - Hi all. Here's a fairly simple question: Does anybody know of a way to get the POST Data from a request in an ISAPI Filter without using I'm trying to port an existing filter to IIS 6.0 and it doesn't support..

POST requests arrive late to ISAPI - Hi, I have an ISAPI running in IIS 5 and 6. For each POST request, starts a worker thread, and returns so it handle other requests. Sometimes a of the worker threads does a long and busy task that might..

IIS6 ISAPI filter: need HTTP header body on POST - I currently use IIS5 and to get the header body on a POST method. However, it is not supported in IIS6. Any

Re3: HTTP 405 when using POST requests - POST requests are finally working. I've disabled write access for all the web site's I've also checked MIME global settings. I found out I have .php and .phtml files as After I removed those POST request..

HTTP 405 when using POST requests - Hello, My server is: Windows 2000 Advanced, SP4 IIS 5 PHP 4.3.4 installed as an CGI extension I'm getting HTTP 405 not error when using a form with a method. method works well, however. When I telnet to port..
Author Message
AptanaPaul

External


Since: Jan 29, 2008
Posts: 1



(Msg. 1) Posted: Tue Jan 29, 2008 12:24 pm
Post subject: ISAPI filter to post-process requests
Archived from groups: microsoft>public>inetserver>iis (more info?)

We are trying to write an ISAPI filter to do post processing of requests.

Here are the requirements of our filter:
1. It needs to hold (blocking) all information until it receives the entire
request (headers, server variables, document body, post data), then it will
process the request and generate headers and body to be sent to the client.
(It just cannot act on pieces of information and move on.)

2. We would like to get postdata regardless if the actual handler requests
it or not. We would like to get it for both http and https requests.

3. (partly in #1) We would like to modify the headers "after" we have
received the entire document.

Here is a little experiment I did (I was told this is not the right
approache, but do not have a better alternative yet):
Register my filter at the global level (so I can get the post data --
but seems still cannot get it if the handler does not ask for it).
Subscribe variouse kinds of events, so I can collect all headers, and
server variables, document body, (and post data).
When we receive the SF_NOTIFY_END_OF_REQUEST event, (this is the
starting point of our own process of the page/request. I can use the
content_length to figure out when I have got the entire doc in the
SF_NOTIFY_SEND_RAW_DATA event, but I do not think that's reliable), we send
all the information we collect for this request (headers, server variables,
document, postdata) to our internal process. The internal process (which
must receive all such information before it returns anything) will process
the request and return a new document with new headers and/or modified
headers. We will update the headers with the ones sent from our process to
the existing headers (add or modify), and send them with the new document to
the client.
I used HTTP_FILTER_CONTEXT* pFC's AddResponseHeaders, but did not see
them in the response received from the browser.

We also thought about writing a Handler that handles all relevent
extensions (eg .asp, .aspx, etc), and in it, we delegate the actual handling
to the proper handler, and intercept the result and modify them. But this
seems not good either.

So given the problem we would like to resolve, how can we make our ISAPI
work?

Thanks,

 >> Stay informed about: ISAPI filter to post-process requests 
Back to top
Login to vote
WenJun Zhang[msft]

External


Since: Dec 16, 2005
Posts: 229



(Msg. 2) Posted: Wed Jan 30, 2008 7:10 am
Post subject: RE: ISAPI filter to post-process requests [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Paul,

First of all, I wonder if you are writing the ISAPI application to run on
Windows 2003 server/IIS 6.0. If so, you'd better to implement the solution
with a new supported wildcard ISAPI extenstion on IIS6 instead of an ISAPI
filter. This is because it isn't recommended to cover any of the following
scenarios in a filter:

1. Accessing entity request body,
2. Potential long-running operation and
3. Using SF_NOTIFY_SEND_RAW_DATA on IIS6

By using a wildcard mapping, your ISAPI extension(execute before any common
extension) can easily interact with all incoming requests of a site/vdir
and modify the responses' header and body. Please take a look at the
following article:

Benefits of Using Wildcard Application Mappings Instead of ISAPI Filters
http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/a
d520e25-877c-4764-bfe5-a9d5a9a5d3bb.mspx?mfr=true

The following references on MSDN should be useful and the corresponding
sample codes can be found in Windows 2003 SP1's Platform SDK.

Intercepting All Incoming IIS Requests
http://msdn2.microsoft.com/en-us/library/ms525696(VS.85).aspx

Remapping a URL Using Wildcard Application Maps
http://msdn2.microsoft.com/en-us/library/ms525529(VS.85).aspx

Implementing Custom Authentication Using Wildcard Application Maps
http://msdn2.microsoft.com/en-us/library/ms525161(VS.85).aspx

Sending Response Headers from ISAPI Extensions
http://msdn2.microsoft.com/en-us/library/ms524895(VS.85).aspx

I hope information above helps. Please update on any further questions or
concerns.

Have a great day.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

 >> Stay informed about: ISAPI filter to post-process requests 
Back to top
Login to vote
WenJun Zhang[msft]

External


Since: Dec 16, 2005
Posts: 229



(Msg. 3) Posted: Fri Feb 01, 2008 11:06 am
Post subject: RE: ISAPI filter to post-process requests [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Hi Paul,

Do you have any further question or concern of this issue?

Have a nice weekend.

Sincerely,

WenJun Zhang

Microsoft Online Community Support

==================================================

Get notification to my posts through email? Please refer to:
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at:

http://msdn.microsoft.com/subscriptions/support/default.aspx.

==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 >> Stay informed about: ISAPI filter to post-process requests 
Back to top
Login to vote
Display posts from previous:   
   Web Hosting Problem Solving Community! (Home) -> IIS All times are: Pacific Time (US & Canada) (change)
Page 1 of 1

 
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



[ Contact us | Terms of Service/Privacy Policy ]