473,473 Members | 2,178 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Getting all of the output from HttpResponse in a module (Custom Filter?).

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?

Jun 20 '07 #1
2 1604
On Jun 20, 10:46 am, Josh Naro <joshn...@gmail.comwrote:
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.

Jun 20 '07 #2
On Jun 20, 11:31 am, Josh Naro <joshn...@gmail.comwrote:
On Jun 20, 10:46 am, Josh Naro <joshn...@gmail.comwrote:
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.
Don't forget to destroy the singleton after use (it'll hang around for
the next request).
Also, you must create a separate singleton for each context you're
working with so that multiple requests are not intermingled.

Jun 20 '07 #3

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

Similar topics

3
by: Jorge Cecílio | last post by:
Hi! I would like to export some MS-Access reports output to pdf. However, the only possibility offered by Access (afaik) for me to export formatted output is snp (snapshot) (I use MS-Office...
0
by: Cybermedia Marketing | last post by:
I'm trying to convert an ISAPI filter to an httpmodule. The ISAPI filter added custom headers to the response which could later be accessed by the asp page. ISAPI Filter: ...
5
by: Brad | last post by:
I created a base page class which sets a response filter and the filter injects additional html into the response output stream. The filter works fine and everything works as expected except for...
4
by: Thomas | last post by:
I want to be able to implement a filter that manipulates the output from the server... Maybe replacing some words, or highlighting a search string, or some other fancy feature... I want to make...
1
by: Stu | last post by:
Hi, I am working on a CMS that uses html templates with placeholder strings for the content (eg: %%Content%%). I want to get the web control working on a blank page. Then intercept the page as...
1
by: Stu | last post by:
Hi, I am trying to grab the page output so I can do some html processing before the page is sent to the browser. I found a post somewhere which suggests that this would grab the page content...
5
by: Ritesh Raj Sarraf | last post by:
import os, sys, logging logger = logging.getLogger("my_app") conerr = logging.StreamHandler(sys.stderr) conerr.setLevel(logging.DEBUG) conerr_formatter = logging.Formatter('%(levelname)s...
1
by: Josh Naro | last post by:
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...
5
by: amit.uttam | last post by:
Hey everyone, I've recently jumped big time into python and I'm working on a software program for testing automation. I had a question about proper logging of output. What I would like is: 1....
0
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...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
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...
0
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.