views:

52

answers:

1

I have a web service accessed via SOAP. I'd really like one of the methods to return a Stream.

What are my options?

My thoughts right now amount to implement Stream and stuff all the data in a string. Is there a type that does this already? If possible (and I don't think it is) I'd love to actually tunnel the stream through SOAP so that data gets pulled lazily even after the method returns.

+1  A: 

Your best bet is to read the Stream into a byte array. You can then serialize the byte array in the web service. The client can then consume the raw byte array and re-assemble it into it's original format.

I've also used the same strategy for uploading files via web service it worked great.

Justin Niessner
I had hoped something a little less brain dead was available, but I guess that would be really tricky to make work.
BCS
FWIW, that is what I did.
BCS