Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

log soap request and response from Wcf web service to a text file using log4net

Is there there any simple way of getting a WCF Service to log SOAP requests and responses to a text file.

I want to log the messages on server, just to clarify.

like image 208
k-dev Avatar asked Sep 07 '11 04:09

k-dev


1 Answers

If you can change the service code to add a behavior, you can hook up an IDispatchMessageInspector and use whichever logging framework to log at the messages there. You can also look at the WCF Message Logging feature, which uses the System.Diagnostic framework to perform the logging (I haven't used log4net yet, maybe they have some trace listener which can be used for this as well).

like image 123
carlosfigueira Avatar answered Nov 15 '22 05:11

carlosfigueira