WCF 4.0 Routing and Manipulating responses at Router
Can anyone point me in the right direction with this issue? We have a WCF central router and we want to manipulate the responses passing through the router based on some xpath criteria. Basically we want to remove a lot of the details from some error requests and sub some extra details in. Ideally we would also like to log the error.
I know it is generally better practice to update the web services to do this but in our case this is not possible and needs to be performed on the router if at all possible.
Also it would be great if we could log each request and response but that is likely a different solution to the manipulation of the responses.
Not sure if you have solved this but...
You should be able to use WCF Behaviours to do what you need.
Have a logging behaviour to log the requests and responses and another one to log errors/manipulate responses
We use behaviours to log to app fabric, and we have one (nasty) behaviour which catches all exceptions and returns a valid response with an error message. I personally don't like this 'feature' but you can basically do anything to your requests/responses with behaviours