tags:

views:

634

answers:

1

I am trying to get streamed output from a WCF service. I have set the transferMode to "StreamedResponse". When client receives the stream from server, it is unable to read the stream. While debugging from server side I can see that the stream has data, but from client side stream.Length throws a not supported exception. Reading the stream into a buffer results in 0 bytes read. I generated the client proxy using svcutil, and am using .NET 3.0. Has anyone experienced a similar problem?

Thanks

+1  A: 

It is hard to help without any details, but note that VS2005 Cassini server (asp.net development server) doesn't support streaming over http.

alex
I am trying to serialize a list of objects and send them to client side via a stream.MemoryStream ms = new MemoryStream(); BinaryFormatter bf = new BinaryFormatter(); bf.Serialize(ms, GetAllCustomers()); return ms;
klone
However when I read a simple text file into a filestream, I can read it at client side.
klone
Do you enforce binary encoding?<customBinding> <binding name="streamingBinding"> <binaryMessageEncoding /> <tcpTransport transferMode=”Streamed” /> </binding></customBinding>
alex
I tried that but with same results.
klone
I ended up using streaming in a different way....I used this example and it worked for me....http://weblogs.asp.net/cibrax/archive/2008/06/10/streaming-large-content-with-wcf-and-deferred-execution.aspx.....except that setting parameters is hard
klone
the above link is not working http://weblogs.asp.net/cibrax/archive/2008/06/10/streaming-large-content-with-wcf-and-deferred-execution.aspx.....except
Miral
http://weblogs.asp.net/cibrax/archive/2008/06/10/streaming-large-content-with-wcf-and-deferred-execution.aspx
SLaks