static void FilterProperties(MessageProperties destination) { // We have the clear out the HTTP Req/Resp props, so we don't accidentally // tell the outbound binding to use whatever Content-Type/Method/QueryString // that the inboudnd message/response used. Otherwise BasicHttp<->WsHttp won't work. object incomingHttpRequest; if (destination.TryGetValue(HttpRequestMessageProperty.Name, out incomingHttpRequest)) { //Store the inbound value for later retoration destination[IncomingHttpRequestName] = incomingHttpRequest; destination.Remove(HttpRequestMessageProperty.Name); } destination.Remove(HttpResponseMessageProperty.Name); //Preserve the Via on the outbound message, HTTP Context using cookies looks at this value //on the original request when sending the response "Set-Cookie" header. Uri incomingVia = destination.Via; if (incomingVia != null) { destination[IncomingViaName] = incomingVia; } }