none
How to set compression in WCF 4.5 and netHttpBinding? RRS feed

  • Question

  • I have a service and I am trying to set compression in a netHttpBinding,. My configuration is:

    <netHttpBinding>
    	<binding name="Test1">
    	  <webSocketSettings transportUsage="WhenDuplex"/>
    	  <security mode="Transport" />
    	  <reliableSession enabled="false"/>
    	</binding>
    </netHttpBinding>

    But I don't have any parameter that let me stablish the compression format. I have to use a custom binding, but then I am not sure if I am using the netHttpBinding properties (benefits of this binding) or not.

    So my question is if it is possible to set the compression format in a netHttpBiding.

    Thanks so much.

    Thursday, December 10, 2015 12:16 PM

Answers

  • Hi ComptonAlvaro,
    As far as I know, the WCF 4.5 has supported the webSocketSetting,

    but if you want to set the compression format in a binding, you need to create a custom binding.

    Because, this property is only exposed on the binaryMessageEncodingBindingElement.

    For more information, please refer to the following articles:

    1.What's New in Windows Communication Foundation 4.5

    https://msdn.microsoft.com/en-us/library/dd456789(v=vs.110).aspx

    2.Compression and the Binary Encoder
    https://msdn.microsoft.com/en-us/library/aa751889(v=vs.110).aspx

    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.

    • Marked as answer by ComptonAlvaro Friday, December 18, 2015 4:09 PM
    Thursday, December 17, 2015 12:37 PM
    Moderator

All replies

  • You are posting to the wrong forum. You should be posting to the MSDN WCF forum, which can be found by using Bing or Google.
    Thursday, December 10, 2015 12:21 PM
  • Hi ComptonAlvaro,
    As far as I know, the WCF 4.5 has supported the webSocketSetting,

    but if you want to set the compression format in a binding, you need to create a custom binding.

    Because, this property is only exposed on the binaryMessageEncodingBindingElement.

    For more information, please refer to the following articles:

    1.What's New in Windows Communication Foundation 4.5

    https://msdn.microsoft.com/en-us/library/dd456789(v=vs.110).aspx

    2.Compression and the Binary Encoder
    https://msdn.microsoft.com/en-us/library/aa751889(v=vs.110).aspx

    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.

    • Marked as answer by ComptonAlvaro Friday, December 18, 2015 4:09 PM
    Thursday, December 17, 2015 12:37 PM
    Moderator