Getting the entire document from response.

J

Josh Naro

I am writing a module that requires the entire output from a web app
to perform its function. So, basically I need to be able to pull the
entire output stream from the Response object. I've tried attaching a
custom filter to Response.Filter, but the custom filter receives the
stream in separate chunks. I need the entire stream at once in order
to convert it to an XmlDocument. Does anyone know of a way to get the
entire output stream from a web app using a module?
 
J

Josh Naro

I am writing a module that requires the entire output from a web app
to perform its function. So, basically I need to be able to pull the
entire output stream from the Response object. I've tried attaching a
custom filter to Response.Filter, but the custom filter receives the
stream in separate chunks. I need the entire stream at once in order
to convert it to an XmlDocument. Does anyone know of a way to get the
entire output stream from a web app using a module?

Well, I managed to figure this one out myself.

Answer:
1. Create a custom filter that makes use of the singleton pattern.
2. Have the filter store each stream as it comes through in a public
variable (i.e. temp += currentStream).
3. Install the filter on BeginRequest of the application from within
a module.
4. Grab your filter on EndRequest of the application from within the
module.
5. Your singleton filter should now have the entire output of the
application in its temp variable.
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top