Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XmlSerializer
Message
From
02/06/2005 15:11:46
Keith Payne
Technical Marketing Solutions
Florida, United States
 
 
To
01/06/2005 03:34:01
General information
Forum:
ASP.NET
Category:
XML
Title:
Miscellaneous
Thread ID:
01018060
Message ID:
01019526
Views:
21
>>Danijel,
>>
>>Have you examined the contents of streamWriter after the call the Transform? The reason I ask is that you are declaring streamWriter as a base stream when you may have intended on declaring an actual streamwriter with the HTTPRequest.GetRequestStream as the base. Another possibility is that in a base stream, the Read, Write, and Seek methods may only be stubs. I couldn't say for sure because I haven't tried to use a base stream.
>>
>>Other than that, I can't see anything wrong with the code from reading it.
>
>Keith,
>
>I couldn't find a way of examining the contents of the streamWriter, partially because Seek() is not supported on that type of stream. That was also why I tried using MemoryStream further down the code, to be able to examine that one instead. That turned out to show blanks as I commented in my code example.
>

The variable streamWriter is declared as a stream, not a stream writer. It's not an error per se, but I thought that it might have contributed to the confusion. For testing, it is probably best to stick with one of the derived stream classes instead of System.IO.Stream or System.IO.StreamWriter. When you are ready to perform the transformation, you can attach a writer to the stream, or you can transform the stream itself and attach a writer afterwards.

>I don't get your second point on declaring streamwriter with the HTTPRequest.GetRequestStream as the base. Isn't that exactly what I'm doing? I'm using System.Net.WebRequest.GetRequestStream() (not System.Web.HTTPRequest.GetRequestStream) which returns System.IO.Stream.
>

System.IO.Stream is an abstract class. As far as I can infer from the documentation, a System.IO.Stream has no backing store. You have to use one of the derived types to make it useful.
System.IO.MemoryStream streamWriter = (System.IO.MemoryStream) req.GetRequestStream();
Since the MemoryStream is already working but showing blanks, I'd look to the XSL file as the likely source of possible errors.

>Any advice is very much appreciated.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform