Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / June 2007

Tip: Looking for answers? Try searching our database.

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

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Josh Naro - 20 Jun 2007 16:46 GMT
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?
Josh Naro - 20 Jun 2007 17:31 GMT
> 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
[quoted text clipped - 3 lines]
> 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.
Josh Naro - 20 Jun 2007 18:48 GMT
> > 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
[quoted text clipped - 16 lines]
>  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.

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.