Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to get raw data from 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?

like image 764
Budda Avatar asked Jan 02 '26 07:01

Budda


1 Answers

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

- 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

<system.diagnostics>
<trace autoflush="true"/>
<sources>
  <source name="System.Net" maxdatasize="1024">
    <listeners>
      <add name="TraceFile"/>
    </listeners>
  </source>
  <source name="System.Net.Sockets" maxdatasize="1024">
    <listeners>
      <add name="TraceFile"/>
    </listeners>
  </source>
</sources>
<sharedListeners>
  <add name="TraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="trace.log"/>
</sharedListeners>
<switches>
  <add name="System.Net" value="Verbose"/>
  <add name="System.Net.Sockets" value="Verbose"/>
</switches>
like image 114
SDReyes Avatar answered Jan 04 '26 22:01

SDReyes



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!