I recently worked on a WCF application and need some features to compress the body of the soap message to reduce the size of the response from the service.
After some research, I found that the implementation is available on the Internet at http://weblogs.asp.net/cibrax/archive/2006/03/29/WS_2D00_Compression-for-WCF.aspx '> http: //weblogs.asp. net / cibrax / archive / 2006/03/29 / WS_2D00_Compression-for-WCF.aspx , the authors of this created a new binding element, "CompressionBindingElement", associated with its channel-related classes.
This compression solution works fine in my WCF application, and the response size has decreased by almost 90%, great! At first I tested it on top of the HTTP binding (meaning user binding using http transport) and everything seems to be good.
As soon as I tried this with net.tcp binding (user binding using tcp transport), the application still worked well. However, when I tested it with some trace tools, I found something strange.
I did a unit test, calling 10 times on the method that the ChannelFactory client created, and explicitly added all the binding elements, including the compression binding element. When I first checked the answer in TcpTrace, I was surprised to see that all these 10 messages were combined into one request.
So, I tried SvcTraceViewer to check the request and found that the socket connection remains open until the service is disconnected. I looked at the processing and considered that all messages, channels were closed for each request, but the connection was simply not closed.
The problem occurred only in net tcp binding with the compression binding element, if the element was not added to the binding or in the http binding everything seems fine.
Has anyone tried this solution and seen the same problem before? Is there anything else I can do to close the connection? Can i skip something
Thanks a lot, Tony.