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

Greg Beech
  • 133,383
  • 43
  • 204
  • 250

2 Answers2

3

You haven't specified what language you are using but assuming C# / .NET you could use SOAP extensions 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

rbrayb
  • 46,440
  • 34
  • 114
  • 174
  • 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. –  Nov 03 '08 at 00:29
0

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

Rob Williams
  • 7,919
  • 1
  • 35
  • 42