How to get raw data from the web service request?


I want to check raw data string (raw xml) received by my web service methods (for logging and debugging purposes).

I saw recommendations: to handle 'BeginRequest' event in HttpApplication. But I don't see which field of 'Request' object contains this POST data?

Related question: Getting RAW Soap Data from a Web Reference Client running in

- Have you seen this answer using tracing? or this one using a SoapExtension

I made following changes in web.cofig to get SOAP(Request/Response) Envelope. It makes trace.log file where all the required information are present

<trace autoflush="true"/>
  <source name="System.Net" maxdatasize="1024">
      <add name="TraceFile"/>
  <source name="System.Net.Sockets" maxdatasize="1024">
      <add name="TraceFile"/>
  <add name="TraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log"/>
  <add name="System.Net" value="Verbose"/>
  <add name="System.Net.Sockets" value="Verbose"/>