Welcome to HostingForumz.com!
FAQFAQ      ProfileProfile    Private MessagesPrivate Messages   Log inLog in

Reading POST data from an ISAPI filter

 
   Web Hosting Problem Solving Community! (Home) -> IIS RSS
Next:  hosting multiple websites  
Author Message
chrispurdum

External


Since: Nov 06, 2003
Posts: 2



(Msg. 1) Posted: Thu Nov 06, 2003 5:43 pm
Post subject: Reading POST data from an ISAPI filter
Archived from groups: microsoft>public>inetserver>iis (more info?)

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
SF_NOTIFY_READ_RAW_DATA? I'm trying to port an existing filter to IIS
6.0 and it doesn't support SF_NOTIFY_READ_RAW_DATA unless you go into
IIS 5.0 compatibility mode, which I'd rather not do.

So, since all I need is the POST data, is there another way to get it?
The reason I want this in a filter instead of an extension is that it
could run for any URL on the site, and sometimes, it redirects users, in
which case, we need to hang on to the POST data somehow so it's not lost
with the 302.

Thanks

Chris

 >> Stay informed about: Reading POST data from an ISAPI filter 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 2) Posted: Thu Nov 06, 2003 11:00 pm
Post subject: Re: Reading POST data from an ISAPI filter [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

That is NOT a fairly simple question!!! Smile

Based on your description, your Filter is a prime candidate for conversion
into an ISAPI Extension configured as a Wildcard Application Mapping on
IIS6.

Since IIS5, it has been possible for an ISAPI Extension to run for any URL
on the entire web server (including website), but with IIS6, it became
possible for the ISAPI Extension to "hand off" anything it couldn't handle
back to IIS to be processed by the actual handler. This ability enables an
ISAPI Extension to "filter" all incoming requests (including entity body --
something that is difficult for ISAPI Filters), decide what to do with it,
and either handle the request or give it back to IIS to be processed.

The ISAPI Extension functionality that you want to look up is
HSE_REQ_EXEC_URL.

Description of Wildcard Application Mapping:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisre...tm/Wild

How to install Wildcard Application Mapping:
http://www.microsoft.com/technet/treeview/default.asp?url=/technet/pro...chnol/w

The underlying function that enables the Wildcard Application Mapping to
function like a request "filter":
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisre...tm/Exte
(you'll want to use the OCT 2003 MSDN Refresh of the documentation, which
has all the corrections/improvements I've made).

I know there's another document on the Wildcard Application Mapping concept,
but I can't seem to find it at the moment.

I expect you'll have more technical questions on "how do I actually build
such a thing?", which you should post to:
microsoft.public.platformsdk.internet.server.isapi-dev

The ISAPI Extension basically:
1. Configure as Wildcard Application Mapping
2. Decide what you want to do.
-- if you want to do nothing, call HSE_REQ_EXEC_URL with everything NULL in
the structure (especially pszUrl=NULL), and you are done
-- if you want to redirect and stop this request, check for POST as a verb
and any entity body. Read in entity body, either synchronous or
asynchronous ReadClient, as necessary. Deal with chunked encoding as
appropriate. If the entity body is <48K (configured as
W3SVC/UploadReadAheadSize), you get the entity body, de-chunked and all, for
free. Then send the 302 response as you wish.

FAR simpler than ISAPI Filters mucking around with SF_NOTIFY_READ_RAW_DATA
because you have the richer functionality of ISAPI Extensions.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Chris Purdum" <ChrisPurdum DeleteThis @cs.com> wrote in message
news:boeiqg$724$1@pixie.nscp.aoltw.net...
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
SF_NOTIFY_READ_RAW_DATA? I'm trying to port an existing filter to IIS
6.0 and it doesn't support SF_NOTIFY_READ_RAW_DATA unless you go into
IIS 5.0 compatibility mode, which I'd rather not do.

So, since all I need is the POST data, is there another way to get it?
The reason I want this in a filter instead of an extension is that it
could run for any URL on the site, and sometimes, it redirects users, in
which case, we need to hang on to the POST data somehow so it's not lost
with the 302.

Thanks

Chris

 >> Stay informed about: Reading POST data from an ISAPI filter 
Back to top
Login to vote
chrispurdum

External


Since: Nov 06, 2003
Posts: 2



(Msg. 3) Posted: Tue Nov 11, 2003 8:13 pm
Post subject: Re: Reading POST data from an ISAPI filter [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

David,
  Thanks for the reply. One more question: Can this new ISAPI extension
read and set HTTP headers/env. variables that the pages/scripts farther
down the line can read? For example, say we want to add
HTTP_MYEXTHEADER = "foo" so an ASP farther down the line can tell that
foo happened, is that possible?

My ISAPI knowledge is definitely pre-6.0 here, but I don't see a
SetHeader or AddHeader type of thing in my old docs.

Also, I'd post this to that other newsgroup
(microsoft.public.platformsdk.internet.server.isapi-dev) , but I can't
find it on the news server I'm using. Got a suggestion for another one?

Thanks in advance,

Chris

David Wang [Msft] wrote:
 > That is NOT a fairly simple question!!! Smile
 >
 > Based on your description, your Filter is a prime candidate for conversion
 > into an ISAPI Extension configured as a Wildcard Application Mapping on
 > IIS6.
 >
 > Since IIS5, it has been possible for an ISAPI Extension to run for any URL
 > on the entire web server (including website), but with IIS6, it became
 > possible for the ISAPI Extension to "hand off" anything it couldn't handle
 > back to IIS to be processed by the actual handler. This ability enables an
 > ISAPI Extension to "filter" all incoming requests (including entity body --
 > something that is difficult for ISAPI Filters), decide what to do with it,
 > and either handle the request or give it back to IIS to be processed.
 >
 > The ISAPI Extension functionality that you want to look up is
 > HSE_REQ_EXEC_URL.
 >
 > Description of Wildcard Application Mapping:
<font color=purple> > <a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/WildcardApplicationMap.asp?frame=true</font" target="_blank">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisre...tm/Wild</a>>
 >
 > How to install Wildcard Application Mapping:
<font color=purple> > <a style='text-decoration: underline;' href="http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/standard/ca_installingwildcard.asp?frame=true</font" target="_blank">http://www.microsoft.com/technet/treeview/default.asp?url=/technet/pro...chnol/w</a>>
 >
 > The underlying function that enables the Wildcard Application Mapping to
 > function like a request "filter":
<font color=purple> > <a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/Extensions_SSF_HSE_REQ_EXEC_URL.asp</font" target="_blank">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisre...tm/Exte</a>>
 > (you'll want to use the OCT 2003 MSDN Refresh of the documentation, which
 > has all the corrections/improvements I've made).
 >
 > I know there's another document on the Wildcard Application Mapping concept,
 > but I can't seem to find it at the moment.
 >
 > I expect you'll have more technical questions on "how do I actually build
 > such a thing?", which you should post to:
 > microsoft.public.platformsdk.internet.server.isapi-dev
 >
 > The ISAPI Extension basically:
 > 1. Configure as Wildcard Application Mapping
 > 2. Decide what you want to do.
 > -- if you want to do nothing, call HSE_REQ_EXEC_URL with everything NULL in
 > the structure (especially pszUrl=NULL), and you are done
 > -- if you want to redirect and stop this request, check for POST as a verb
 > and any entity body. Read in entity body, either synchronous or
 > asynchronous ReadClient, as necessary. Deal with chunked encoding as
 > appropriate. If the entity body is <48K (configured as
 > W3SVC/UploadReadAheadSize), you get the entity body, de-chunked and all, for
 > free. Then send the 302 response as you wish.
 >
 > FAR simpler than ISAPI Filters mucking around with SF_NOTIFY_READ_RAW_DATA
 > because you have the richer functionality of ISAPI Extensions.
 >

--
Chris Purdum
Virtual Locksmith (SNS/VL Development)
ChrisPurdum.TakeThisOut@cs.com
650-937-4229
IM: PurdumCS

When confronted by a difficult problem, you can solve it more easily by
reducing it to the question, "How would the Lone Ranger handle this?"<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Reading POST data from an ISAPI filter 
Back to top
Login to vote
someone9

External


Since: Aug 25, 2003
Posts: 2419



(Msg. 4) Posted: Wed Nov 12, 2003 5:54 pm
Post subject: Re: Reading POST data from an ISAPI filter [Login to view extended thread Info.]
Archived from groups: per prev. post (more info?)

Yes. The ISAPI Extension, using HSE_REQ_EXEC_URL, can rewrite the entire
request, so it can definitely add/remove HTTP Headers as perceived by
subsequent handlers. With HSE_REQ_EXEC_URL, your ISAPI Extension can finally
tell IIS "go execute this request instead, with these headers, this entity
body, this verb, this URL" -- including "use whatever the incoming values
were" (i.e. pass-thru).

I'm using msnews.microsoft.com to access
microsoft.public.platformsdk.internet.server.isapi-dev . You'll definitely
want to post your ISAPI-related questions there.

--
//David
IIS
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Chris Purdum" <ChrisPurdum.TakeThisOut@cs.com> wrote in message
news:3FB18932.7090300@cs.com...
David,
Thanks for the reply. One more question: Can this new ISAPI extension
read and set HTTP headers/env. variables that the pages/scripts farther
down the line can read? For example, say we want to add
HTTP_MYEXTHEADER = "foo" so an ASP farther down the line can tell that
foo happened, is that possible?

My ISAPI knowledge is definitely pre-6.0 here, but I don't see a
SetHeader or AddHeader type of thing in my old docs.

Also, I'd post this to that other newsgroup
(microsoft.public.platformsdk.internet.server.isapi-dev) , but I can't
find it on the news server I'm using. Got a suggestion for another one?

Thanks in advance,

Chris

David Wang [Msft] wrote:
 > That is NOT a fairly simple question!!! Smile
 >
 > Based on your description, your Filter is a prime candidate for conversion
 > into an ISAPI Extension configured as a Wildcard Application Mapping on
 > IIS6.
 >
 > Since IIS5, it has been possible for an ISAPI Extension to run for any URL
 > on the entire web server (including website), but with IIS6, it became
 > possible for the ISAPI Extension to "hand off" anything it couldn't handle
 > back to IIS to be processed by the actual handler. This ability enables
an
 > ISAPI Extension to "filter" all incoming requests (including entity
body --
 > something that is difficult for ISAPI Filters), decide what to do with it,
 > and either handle the request or give it back to IIS to be processed.
 >
 > The ISAPI Extension functionality that you want to look up is
 > HSE_REQ_EXEC_URL.
 >
 > Description of Wildcard Application Mapping:
 >
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/WildcardApplicationMap.asp?frame=true" target="_blank">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisre...tm/Wild</a>
 >
 > How to install Wildcard Application Mapping:
 >
<a style='text-decoration: underline;' href="http://www.microsoft.com/technet/treeview/default.asp?url=/technet/prodtechnol/windowsserver2003/proddocs/standard/ca_installingwildcard.asp?frame=true" target="_blank">http://www.microsoft.com/technet/treeview/default.asp?url=/technet/pro...chnol/w</a>
 >
 > The underlying function that enables the Wildcard Application Mapping to
 > function like a request "filter":
 >
<a style='text-decoration: underline;' href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/Extensions_SSF_HSE_REQ_EXEC_URL.asp" target="_blank">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisre...tm/Exte</a>
 > (you'll want to use the OCT 2003 MSDN Refresh of the documentation, which
 > has all the corrections/improvements I've made).
 >
 > I know there's another document on the Wildcard Application Mapping
concept,
 > but I can't seem to find it at the moment.
 >
 > I expect you'll have more technical questions on "how do I actually build
 > such a thing?", which you should post to:
 > microsoft.public.platformsdk.internet.server.isapi-dev
 >
 > The ISAPI Extension basically:
 > 1. Configure as Wildcard Application Mapping
 > 2. Decide what you want to do.
 > -- if you want to do nothing, call HSE_REQ_EXEC_URL with everything NULL
in
 > the structure (especially pszUrl=NULL), and you are done
 > -- if you want to redirect and stop this request, check for POST as a verb
 > and any entity body. Read in entity body, either synchronous or
 > asynchronous ReadClient, as necessary. Deal with chunked encoding as
 > appropriate. If the entity body is <48K (configured as
 > W3SVC/UploadReadAheadSize), you get the entity body, de-chunked and all,
for
 > free. Then send the 302 response as you wish.
 >
 > FAR simpler than ISAPI Filters mucking around with SF_NOTIFY_READ_RAW_DATA
 > because you have the richer functionality of ISAPI Extensions.
 >

--
Chris Purdum
Virtual Locksmith (SNS/VL Development)
ChrisPurdum.TakeThisOut@cs.com
650-937-4229
IM: PurdumCS

When confronted by a difficult problem, you can solve it more easily by
reducing it to the question, "How would the Lone Ranger handle this?"<!-- ~MESSAGE_AFTER~ -->
 >> Stay informed about: Reading POST data from an ISAPI filter 
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 ]