tags:

views:

57

answers:

1

I have a operation contract that is like this:

public interface ISearch
{
    [OperationContract]
    System.IO.Stream DownloadFile(string file);

}

the binding is nettcpbinding, and when i set buffered and streamed transfer mode, the wcf seems both work. so how can i test whether the wcf is working in streamed mode?

+2  A: 

Send back a file that is larger than your setting for maxReceivedMessageSize on your binding configuration (default is 64KB). If WCF is in Buffered mode, it should fail. If it's in Streamed or StreamedResponse mode, it should work.

marc_s
I tested, it seems even in streamed mode, wcf fails because of the maxReceivedMessageSize is exceeded.
Benny
it could also fail because of a timeout - can you post your service code, and the service and client config, please?
marc_s
the exception is not timeout exception. let me do more test. get back soon. i think the maxReceivedMessageSize always work either in buffered or streamed mode. see this post: http://haveyougotwoods.com/archive/0001/01/01/wcf-message-streaming.aspx its config always give a bigger value to maxReceivedMessagSize even in streamed mode
Benny
@marc_s, yeah. after test. it's pretty clear that maxReceivedMessageSize works either in buffered or streamed mode.
Benny
add some code here and further question:http://stackoverflow.com/questions/2037521/why-i-can-use-bitmap-as-return-type-whehttp-stackoverflow-com-questions-1287815
Benny