Capture SOAP request

Asked

Viewed 943 times

4

I would like to log all Soap requests exactly as they arrived on my server. There is a way this can be done via c#?

  • ASP.NET Web Services (ASMX) to WCF?

  • We use ASMX for these webservices

2 answers

3


1

An alternative is to enable tracing your application. Add to file .config of your Web Service the following:

<system.diagnostics>
    <trace autoflush="true" />
    <sources>
        <source name="System.Web.Services.Asmx">
            <listeners>
                <add name="AsmxTraceFile" type="System.Diagnostics.TextWriterTraceListener" initializeData="local.log" traceOutputOptions="LogicalOperationStack, DateTime, Timestamp, ProcessId, ThreadId" />
            </listeners>
        </source>
    </sources>
    <switches>
        <add name="System.Web.Services.Asmx" value="Verbose"  />
    </switches>
</system.diagnostics>

See more here.

Furthermore, it is possible to use dependency injection to intercept calls to the Web Service. This can be done by generating an access layer proxy. The explanation is here.

  • But the xml of the request does not come in the case of tracing right? I would like the full xml for my client to verify that who is calling erroneously the webservice is it.

  • It is to come yes. The tracing includes serialization and deserialization information.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.