简体   繁体   中英

Why doesn't wsHttpBinding support streaming?

Why doesn't wsHttpBinding support streaming?

EDIT: To test my comment about netTcpBinding, I tried following code, which gives runtime error:

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

Runtime exception:

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

if <reliableSession enabled="true"/> is removed, the code works.

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

As stated here ...more info about WS-RM .

There is also another post here that provides the reasoning for not being able to stream versus the why above...

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...

In addition netTcpBinding actually makes use of WS-RM for reliability purposes.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM