how to test if the wcf is really in streaming mode?
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 开发者_如何学Pythonwcf seems both work. so how can i test whether the wcf is working in streamed mode?
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.
Probably a very crude method, but, you can use windows resource monitor to validate that wcf is actually streaming the file. Here I was streaming a large file from a service hosted in IIS. Read/s and Write/s clearly shows that the file is being read while streaming and is not buffered.
精彩评论