wcf - 为什么wsHttpBinding不支持流传输?

标签 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"/>,则该代码有效。

最佳答案

WsHttpBinding doesn't support streaming due to the reliable messaging protocol (WS-RM), which requires that messages are buffered on either end.



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

还有另一个here帖子,提供了无法进行流播的原因以及上述原因的原因...

This is because WS-RM needs to apply signing/checksums to the whole message as a unity, etc; and this is not possible when streamed transferMode, only with buffered transferMode...



此外,netTcpBinding实际上出于可靠性目的而使用WS-RM。

关于wcf - 为什么wsHttpBinding不支持流传输?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4412553/

相关文章:

.net - 从 wcf 客户端调用需要基本 http 身份验证的 Web 服务

.net - WCF - 赢取应用程序 “The maximum string content length quota (8192) has been exceeded while reading XML data.”

C# 文件位置难题

wcf - 如果没有本地计算机上的服务器证书,客户端 WCF 无法连接到服务器 WCF

用于调用 Web 服务的 C# 类的 C++ 包装器类

c# - 如何将 WPF DataGrid 绑定(bind)到 ObservableCollection

c# - 如何关闭wcf客户端

C# WCF NetTCPBinding 阻塞应用程序

wcf - 如何从独立的 WCF 服务访问 Sitecore 项目

wcf - WF4 WCF 关联和 MessageContract 不起作用