473,738 Members | 7,110 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Request.InputSt ream to multiple xmlreaders

XmlTextReader requestdata = new XmlTextReader(R equest.InputStr eam);
XmlTextWriter xmltextwriter = new XmlTextWriter(s omefile,someenc oding);
XmlTextWriter xmltextwriter2 = new
XmlTextWriter(s omefile2,someen coding);

xmltextwriter.W riteNode(reques tdata, false);
// i want to write to another writer here by resetting the reader

xmltextwriter2. WriteNode(reque stdata, false);

using requestdata.Res etState() resets the reader but appears to also
remove the stream.

trying to create two XmlTextReaders from the same stream
(Request.InputS tream) doesn't work either..

is it possible to send a stream to multiple sources?

thanks in advance-

Nov 12 '05 #1
1 2120
Ch************* @gmail.com wrote:
XmlTextReader requestdata = new XmlTextReader(R equest.InputStr eam);
XmlTextWriter xmltextwriter = new
XmlTextWriter(s omefile,someenc oding); XmlTextWriter xmltextwriter2 =
new XmlTextWriter(s omefile2,someen coding);

xmltextwriter.W riteNode(reques tdata, false);
// i want to write to another writer here by resetting the reader

xmltextwriter2. WriteNode(reque stdata, false);

using requestdata.Res etState() resets the reader but appears to also
remove the stream.

trying to create two XmlTextReaders from the same stream
(Request.InputS tream) doesn't work either..

is it possible to send a stream to multiple sources?


You could read the request's InputStream to a MemoryStream, and use
that as source for your readers.

Cheers,
--
http://www.joergjooss.de
mailto:ne****** **@joergjooss.d e
Nov 12 '05 #2

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

Similar topics

6
3145
by: Daniel Rimmelzwaan | last post by:
I want to send a biztalk document to an aspx page, and I need to see some sample code, because I just can't make it work. I have a port with transport type HTTP, pointing to my aspx page, something like http://myserver/mypage.aspx. From there it gets blurry, because I just can't figure out how to do the rest. Does anybody have a sample page for me that I can take a look at? Just a simple one that takes whatever biztalk sends and saves it...
4
3216
by: PJ | last post by:
I would like to capture a request stream before the request has been completely sent to the server for the sake of saving the bytes of a posted file to disk. I have written httpmodules before, but (correct me if I am wrong) it seems that by the ProcessRequest event, the Request has been completely sent and aspnet_wp has used it to hydrate the httpcontext instance. Is there a .net way of capturing an http request as it comes in to the...
7
4145
by: Shapiro | last post by:
I have a scenario where I log a resquest to a database table and update the request with a corresponding response including the response time. I am using an HttpModule to do this. My challenge is how to corelate the response to a corresponding request. I am looking for a sure proof threadsafe way to corelate a response to a coresponding request message. Two things that concerns me:-
0
2934
by: Amar | last post by:
I am recieving the "The root element is missing" error from my soap extension while attempting to validate an incoming SOAP message request. I suspect the problem resides in the ChainStream method but I'm not sure. Below is a water-downed version of the code that I'm working on. While debugging, I noticed that if I pass an invalid SOAP request, the schema validation catches it and throws the error appropriately. However, when I pass in a...
6
9688
by: Karthik | last post by:
I am trying to read Http request body values NOT form values The content type is text/xml and its POST I am posting data from Infopath to an asp.net page. In ASP it works by just writing Response.Write(request) the same does not work in ASP.NET I tried using Rquest.BinaryrRead() and Request.InputStream but it gives me text values as space separated (eg Karthik yyyy aaaa) whereas the data i am looking out for is in XML format.
3
1201
by: Jacob | last post by:
Hi All, Is there a way to get the contents of a web service request? Preferably including the HTTP headers too. I tried saving Context.Request.InputStream to a stream, but it always appears to be 0 length. Is that because it's only used in a regular Page request and not for web services?
0
1460
by: kaczmar2 | last post by:
Hello, I have an aspx page which is posting xml content to another asp.net page, but the request.length is always 0. I think there should be something there. below is the code for the requesting page and consuming page. Does anyone have any insight? Thanks. //CLIENT PAGE string xml = "<foo />"; string uri = string.Concat("http://localhost/consume-req.aspx);
1
1916
by: chandy | last post by:
Hi all, I want to evaluate the size of the http request sent to my webservice. How can I accomplish this? System.Web.HttpContext.Current.Request seems to return the http request for the browser on the aspx page that the service is called from, not the call to the service itself. Any ideas?
3
1768
by: Joseph Geretz | last post by:
I'm using the Request Filter documentation which can be found here: http://msdn.microsoft.com/en-us/library/system.web.httprequest.filter.aspx In this example, two filters are installed, one filter uppercases every alphabetic character and then the second filter replaces every 'E' with "#'. OK, very nice. What's trivial about these examples is that the returned string is exactly the same length as the string which is actually read...
0
9335
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9208
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8210
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4570
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
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 we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.