I would like to log all soap requests exactly as they arrived on my server. Is there a way to do this via C #?
I would like to log all soap requests exactly as they arrived on my server. Is there a way to do this via C #?
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.
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>
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 .