为什么wsHttpBinding不支持流媒体?

时间:2010-12-10 19:27:49

标签: wcf

为什么wsHttpBinding不支持流媒体?

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

<netTcpBinding >
        <binding name="myBinding"  transferMode="Streamed">          
          <reliableSession enabled="true"/>
        </binding>
</netTcpBinding>

运行时异常:

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

如果删除了<reliableSession enabled="true"/>,则代码可以正常运行。

1 个答案:

答案 0 :(得分:12)

  

WsHttpBinding不支持   流媒体由于可靠   消息传递协议(WS-RM),其中   要求缓冲消息   两端。

如上所述here ...有关WS-RM的更多信息。

还有另一篇帖子here提供了能够与上述原因进行比较的推理......

  

这是因为WS-RM需要申请   签署/校验和整个消息   作为一个团结等;而事实并非如此   流式传输模式时可能,   只有缓冲的transferMode ...

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

相关问题