How to Compress Traffic between Client and Server

Topics: WCF Data Services
Dec 26, 2013 at 7:47 AM
In the blog, it mentioned that WCF Data Service team have made it possible for developers to directly handle the request and response streams themselves. This was built on top of ODataLib's IODataRequestMessage and IODataResponseMessage framework that specifies how requests and responses are sent and recieved.

But what to do?!
Dec 26, 2013 at 6:01 PM
Here's an example of how to do this using the WCF Data Services client library:


Glenn Gailey
Dec 27, 2013 at 1:37 AM
There is no WritingRequest or similar Event I can use in winform or other client.
Is there any other way? or i can insist on this way?
Dec 28, 2013 at 7:43 PM
The version of the client installed with the WCF Data Services 5.6.0 Tools has these events on DataServiceContext.
Dec 29, 2013 at 4:42 PM
Thanks again.
Do you mean SendingRequest2 event?
In this event, I can't set the Request Message or Stream Content.
Dec 29, 2013 at 4:56 PM
Edited Dec 29, 2013 at 5:28 PM
And my wcf data service version is 5.6.
and after i install the WCF Data Services 5.6.0 Tools, nothing happened.
In SendingRequest2, e.RequestMessage is readonly.
e.RequestMessage.GetStream() is not surpported.
Dec 29, 2013 at 9:06 PM
Sorry for my confusion. The new events are BuildingRequest and ReceivingResponse, but I'm not clear on how to correctly hook into the response stream in ReceivingResponseEventArgs.ResponseMessage, and I can't find this new pattern documented anywhere.
Have you tried posting this question to the WCF Data Services forum?
Dec 30, 2013 at 1:57 AM
Yes, I have post it to the forum.
I think the most possible event is SendingRequest2, because It happened before send stream.
I have post it to here
Custom Compression to Request and Response
Jan 14, 2014 at 2:46 PM
Edited Jan 14, 2014 at 2:47 PM
There is no nobody answer my question in WCF Data Services forum.
Sep 24, 2014 at 11:25 AM
Edited Sep 24, 2014 at 11:30 AM

I'm looking at hooking into this event to implement Deep Inserts for web api odata 4, but like the original poster, am having trouble accessing the stream representing the body.

e.RequestMessage.GetStream() throws a NotSupportedException.

Is there any update on this issue?


throws ArgumentException Stream was not readable