views:

395

answers:

1

A collegue of mine needs to implement custom logging of WCF messages, for debugging purposes, but also for traceability (logged data will be saved for future reference and verification).

Examples like this one, Capture XML In WCF Service, shows how to do this for the host, but he needs it for the client application.

Can anyone help me/him with some pointers to what to look for, or where to start?

Since we need to talk to a database to log the data, a simple configuration change to log to a file on disk, like this MSDN example, Configure Message Logging, is not enough for our needs.

This is a C# 3.0 application for .NET 3.5.

+1  A: 

The example you cited: it is very similar/dual for the client. Instead of IDispatchMessageInspector, there's IClientMessageInspector. Instead of IServiceBehavior, use IEndpointBehavior, etc. The OM will steer you in the right direction.

Brian