O'Reilly logo

Microsoft Windows Communication Foundation 4.0 Cookbook for Developing SOA Applications by Steven Cheng

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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] ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required