Capture SOAP request

4

I would like to log all soap requests exactly as they arrived on my server. Is there a way to do this via C #?

    
asked by anonymous 13.04.2015 / 15:39

2 answers

3

I found this link link

In webmethod it would look like this:

[WebMethod]
[TraceExtensionAttribute]
public Type MethodName()

Resolved my problem, as I did not find an option in the tracing that would store the complete xml of the request.

Thanks to all who helped me.

    
13.04.2015 / 16:58
1

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

<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 .

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

    
13.04.2015 / 15:47