Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why doesn't wsHttpBinding support streaming?

Tags:

wcf

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.

like image 814
morpheus Avatar asked Dec 10 '10 19:12

morpheus


1 Answers

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.

like image 145
Aaron McIver Avatar answered Nov 16 '22 01:11

Aaron McIver