Unable to pass an object of type "MessageBodyStream" to enter "System.IO.MemoryStream"

I am returning memystream as a stream from my wcf server. When I get this in the client and drop it back to the MemoryStream, I get this error.

I don’t understand where MessageBodyStream came from, since I never used it. Can someone tell me a solution to this problem?

Thank.

+3
source share
3 answers

This post suggests that you first read this stream into your MemoryStream if you want to access it as a MemoryStream. Because any sent stream is accepted as a MessageBodyStream .

+3
source

Stream MemoryStream?

, , , :

, MemoryStream, System.ServiceModel.Dispatcher.StreamFormatter.MessageBodyStream ( ).

http://christopherdeweese.com/blog2/post/streaming-in-wcf-knowing-is-half-the-battle

MSDN : http://msdn.microsoft.com/en-us/library/ms733742.aspx

+6

MessageBodyStream MemoryStream , . Stream.

+2

All Articles