Ok, it works but not like I'am expecting...
Imagine that I want to encrpyt the result of a MediaTypeProcessor (png for example). My "ResponseEncrypter2" Processor should be called after the "WriteToStream" method of the Png Processor (or any other MediaTypeProcessor).
But If I make my ResponseEncrypter processor as Glen said :
public class ResponseEncrypter2 : Processor<HttpResponseMessage, object>
public override ProcessorResult<object> OnExecute(HttpResponseMessage HttpResponseMessage)
// Make encryption
HttpResponseMessage.Content = HttpContent.Create("Data encrypted");
return new ProcessorResult<object>();
I register it and the png processor as follow :
public override void RegisterResponseProcessorsForOperation(HttpOperationDescription operation, IList<Processor> processors, MediaTypeProcessorMode mode)
// Add media processors
processors.Add(new PngProcessor(operation, mode));
processors.Add(new JpgProcessor(operation, mode));
// Encryption processor
With that configuration, "ResponseEncrypter2 OnExecuteMethod" is called but the "WriteToStreamMethod" of the PngProcessor is never called. So on real case, I could never encrpyt the result of the "writeToStream" method... What
I will expect is that the "ResponseEncrypter" will be called at the end of all processors treatments (particulary, after the "writeToStream" method)...
Golbally, on my opinion, on this new Api, process orders management is not very clear...