views:

6580

answers:

3

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?

+1  A: 

See this answer for info on WCF logging. You can log to a file, and there is a special viewer to make reading the logs easy.

Your windows configuration file is named AppConfig.xml rather than WebConfig.xml and lives in the bin folder alongside the exe file. Within Visual Studio there is a "top level" AppConfig file that VS copies to the bin folder when you compile. You may need to add the AppConfig file to your project -- it is a special file type in the Add Item dialog.

+tom

Tom A
+1  A: 

In the above post, that should be "app.config" and "web.config", and the better URL is the one at http://msdn.microsoft.com/en-us/library/ms730064.aspx.

John Saunders
+1  A: 

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

Note: seems to be a bug in stackoverflow - the URL is: http://msdn.microsoft.com/en-us/library/esw638yk(VS.71).aspx

Another article is How can I log my .NET SOAP requests.

nzpcmad