views:

1623

answers:

4

In my web application, I need to log all the SOAP messages to my SQL 2005 database whenever I make a web service call to my business partners' web service. How do I accomplish that?

Thanks in Advance,

Tony

+3  A: 

You haven't specified what language you are using but assuming C# / .NET you could use SOAP extensions.aspx) to get the SOAP content as a string and then use a simple INSERT to add to an arbitrary DB table.

There are probably far more elegant methods but I've implemented the above and it works fine.

Just remember to have a large column size in the DB table since the SOAP output could potentially be large.

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

nzpcmad
Thank you very much for your answer.
I need to figure out a way to deploy my SOAP message logging dll from DEV environment to production environment without recompiling my code. Where do you recommend to store the database information? Registry or app.config?Thanks.
I use this method as well,and while it's not what I would call elegant, it is rock-solid.
cori
A: 

The sample of logging all the traffic for the web service from MSDN

You may also want to take a look at responses to this question => How do I get access to SOAP response

Vlad N
A: 

Consider using Log4net configured with an Appender that targets the database table.

Rob Williams
A: 

Thanks to everyone.