C# SOAP Web Services client – example that shows how to log all raw SOAP intput and output

cloggingsoapweb services

I'm looking for a C# example showing how to access a remote SOAP Web Service, and logging (to a file, or even just to a string I can do whatever with) all complete raw SOAP requests and complete raw SOAP responses.

I found some other posts on StackOverflow with similar topics, but they seem to reference a web.config file, which my desktop application does not have. I assume this is because they are using C# in the form of a web application querying a remote SOAP web service. Mine is a desktop application.

Any takers?

Best Answer

You could use SOAP extensions to get the SOAP content as a string and then log it wherever.