How to create a custom binding that has the benefits of the netHttpBinding? RRS feed

  • Question

  • I would like to use netHttpBinding because for the duplex communitaction it use only one channel, so it is a good feature for scalability reasons. The problem is that I would like to use compression too, but is it not possible set this parameter in the netHttpBidings, so I have to create a custom binding.

    I have this custom binding:

            <binding name="CustomBinding_IWcfContract" sendTimeout="00:05:00">
              <binaryMessageEncoding compressionFormat="Deflate"/>
              <reliableSession />
              <tcpTransport transferMode="Streamed" maxReceivedMessageSize="2147483647" />

    But I don't know if I use a duplex contract I use one or two channels. So my dount is how to create a custom binding that has the same behavior than the netHttpBinding?


    Friday, December 18, 2015 4:19 PM


  • Hi ComptonAlvaro

    As far as I know, the tcp protocol is support the duplex connection.

    So, in your code, you set the tcpTransport then it will use the Tcp protocol.

    Also you can set the <compositeDuplex> in your code.

    This  binding element that is used when the client must expose an endpoint for the service to send

    messages back to the client

    For more information, please refer to the following articles:



    Fun with Duplex contracts

    Best Regards,

    Wanjun Dong

    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Friday, December 25, 2015 3:15 AM