为什么wsHttpBinding不支持流媒体?

mor*_*eus 10 wcf

为什么wsHttpBinding不支持流媒体?

编辑:为了测试我对netTcpBinding的评论,我尝试了下面的代码,它给出了运行时错误:

<netTcpBinding >
        <binding name="myBinding"  transferMode="Streamed">          
          <reliableSession enabled="true"/>
        </binding>
</netTcpBinding>
Run Code Online (Sandbox Code Playgroud)

运行时异常:

Unhandled Exception: System.InvalidOperationException: Transfer mode Streamed is
 not supported by ReliableSessionBindingElement.
   at System.ServiceModel.Channels.ReliableSessionBindingElement.VerifyTransport
Mode(BindingContext context)
Run Code Online (Sandbox Code Playgroud)

如果<reliableSession enabled="true"/>删除,代码工作.

Aar*_*ver 12

由于可靠的消息传递协议(WS-RM),WsHttpBinding不支持流式传输,这要求消息在任一端缓冲.

如前所述这里 ...更多信息WS-RM.

也有另一篇文章在这里它提供了推理能够,为什么上面流兑...

这是因为WS-RM需要将签名/校验和作为统一等应用于整个消息; 当流传输模式时,这是不可能的,只有缓冲的transferMode ...

此外,netTcpBinding实际上使用WS-RM来实现可靠性.