views:

62

answers:

1

Hi guys,

I need to provide non repudiation in my WCF services and want to store all my incomming SOAP requests into a SQL server DB with signature/security data and all the envelope stuff.

This way, when a problem occurs, we can tell to the client "Hi, THIS is your signed message" exactly as you wrote it. To do this, I need to store a relationship between the SOAP envelope XML's and my persisted bussiness objects/transactions.

Example: THIS is the SOAP Envelope used to add Customer ID=4567 to my Customers datables.

I need to establish a link between SOAP envelope and the bussiness transaction performed by my app. Storing @@identity of the logged message could be a solution. But, where do I put it? In the SOAP Body? Keep it in memmory?

I've reading about logging in WCF and wrote a Database Logger that inserts into tables the log info instead a text file, but i don't know how to link this data with the parsed/deserialized bussines datacontract object that arrives to my WCF service's method. I don't even know if this is the rigth approach!

Any pattern/tip/hint/tool/help would be appreciated. Thanks.

A: 

If you have enabled the message logging feature of WCF (http://msdn.microsoft.com/en-us/library/ms730064.aspx), you can write a custom listener, and there add all the logic you need. To write a custom listener you only have to implement the TraceListener interface (fairly simple) and then configure WCF to use it, adding it to the listeners section inside the system.diagnostics, replacing the default listener.

Alejandro Martin
And how do I share data between the Listener and my service implementation code?
Sergio Gianfrancesco