I have a WCF client proxy which reads from a SOAP web service. I do not control the service, only the client proxy. The result of invoking one of the operations of the service is defined as a very large XML schema, of which only a small subset is relevant in my application.
I have created a custom WCF behavior which allows me to parse the raw XML response and read only the relevant parts. However, the proxy still deserializes the response into an object graph (which is quite complex as a result of the XML schema). As far as my application is concerned, this last step is superfluous.
Is it possible to prevent my WCF client proxy from performing the last step of deserializing the response?
Where exactly do you want to process the parts of the message you want? In general, it sounds to me like you don’t really want the default client proxy generated, and you’d be better off with your own custom client proxy.
If you can go that route, one option that would be available would be to simply have the proxy return a Message object instead of a real DataContract, and then you can easily read the raw XML from the SOAP body yourself and parse it. Easier than trying to mess with the serializer, imho.