How do I make an ISerializable Stream (or close enough)
I have a web service that is accessible via SOAP. I would really like one of the methods to return a Stream.
What are my options?
My thoughts now are implementing a Stream and populating all the data in a string. Is there a type that does this already? If it is possible (and I don't think it is), I would like the streams through the SOAP stream to be streams, so that the data becomes lazy even after the method returns.
+1
a source to share
1 answer
Your best bet is to read the stream into a byte array. Then you can serialize the byte array in the web service. The client can then use the original byte array and reassemble it to its original format.
I also used the same strategy for uploading files via a web service, which it worked great with.
+1
a source to share