views:

2057

answers:

5

I'm consuming a third party .NET WebService in my client application. For debugging purposes I want to capture the SOAP requests that are being sent from my server. How would I go about doing this? This is being done on .NET 2.0 without the use of WCF or WSE.

+3  A: 

If it's for debugging purposes I'd just configure the web request to use a proxy and send the entire request though fiddler (http://www.fiddlertool.com) then you can see exactly what's getting transmitted over the wire.

WaldenL
I tried about 6 different ways of doing this in code before giving up and trying fiddler. Had I read about it and seen that it supports encrypted traffic I would have started with it first.
carson
+1  A: 

There are many options you can use. There are certainly some commercial tools for this (like SOAPScope), but if you're just looking to capture the raw contents of the requests/responses there are several tools out there besides Fiddler (that Walden mentioned already).

Personally, I've been a long time user of Simon Fell's TcpTrace and YATT.

If you're interested in actually instrumenting the code so that it can do it on its own (say, by logging everything to a file or something), then you might want to look into implementing a SoapExtension on your server.

tomasr
A: 

You can use a SoapExtension to log the Soap calls.

http://msdn.microsoft.com/en-us/magazine/cc164007.aspx

FlySwat
A: 

Instead of logging the SOAP message to a text file, how do you log it to a database?

A: 

I've used the Web Service, SOA and SOAP Testing Tool - soapUI with good success in the past.

-Edoode

edosoft