I have a custom operation invoker (something along the lines of the TaskDispatcher sample), where I'm eventually trying to set the status code and headers of the outgoing response. I tried the following:
1) Created HttpResponseMessageProperty on OperationContext's outgoing message properties and set status code on that
2) Tried setting WebOperationContext.Current.OutgoingResponse.StatusCode
Neither of the options above had the desired effect. Is WebAPI ignoring WebOperationContext/ outgoing message properties? If so, is there any way at all to manipulate outgoing status code/headers from an operation invoker? I know there are probably
other WebAPI hooks where I could do this in an easier fashion, but for my specific purpose, I need to do it in the invoker (unless there is absolutely no way of doing so).
Would appreciate any inputs on this.