Capturing SOAP requests to an ASP.NET ASMX web service

Posted by pcampbell on Stack Overflow See other posts from Stack Overflow or by pcampbell
Published on 2010-04-12T19:04:09Z Indexed on 2010/04/12 20:03 UTC
Read the original article Hit count: 416

Filed under:
|
|
|

Consider the requirement to log incoming SOAP requests to an ASP.NET ASMX web service. The task is to capture the raw XML being sent to the web service.

The incoming message needs to be logged for debug inspection. The application already has its own logging library in use, so the ideal usage would be something like this:

//string or XML, it doesn't matter.
string incomingSoapRequest = GetSoapRequest();

Logger.LogMessage(incomingSoapRequest);

Are there any easy solutions to capture the raw XML of the incoming SOAP requests? Which events would you handle to get access to this object and the relevant properties?

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about web-services