11

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.

morpheus
  • 18,676
  • 24
  • 96
  • 159

1 Answers1

14

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.

Aaron McIver
  • 24,527
  • 5
  • 59
  • 88
  • 1
    thanks. any idea why WS-RM requires messages to be buffered? The netTcpBinding offers both reliability and streaming, so I am guessing reliability does not preclude streaming. – morpheus Dec 10 '10 at 20:02