Altering operation messages via MessageInspector
In this chapter, we have covered many WCF extension components that can intercept the service operation calls, including OperationInvoker
, ParameterInspectors
, and MessageFilter
. Each of them focuses on a certain point within the entire WCF operation execution process. This recipe will introduce another extension component, MessageInspector
, which can help intercept the entire SOAP message of each WCF operation call.
How to do it...
In our sample scenario, we have a WCF service that contains an operation that returns a list of ProductItem
objects (each of which contains a Name
and an Amount
property). The ServiceContract
and related data types are shown in the following code snippet:
[ServiceContract] ...
Get Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.