Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

webservices trace / log

I have set of web services and I want to add a trace layer. I don't want to modify each web service since I have many. I would like to write log every entering to a web service: name of web service and parameters.

What is the best way to do so?

P.S. I am using asp.net and C#.

EDIT: I only want to wrap the web services as each one will have log(..) at the beginning.

like image 405
Naor Avatar asked Jan 08 '11 03:01

Naor


People also ask

What is trace log WebSphere?

Trace log file Using the WebSphere Application Server administrative console, you can configure some settings of the logs, such as the location, name, maximum size of the log files and the level of detail that you want to log (such as Fine, Finer, Finest). For more information, refer to Configuring log settings.


1 Answers

A common way to achieve this is to inject a SOAP extension. From there you can intercept every request/response packet in raw SOAP. The sample shows how to implement one, and the explanation describes how it works and how to configure it.

Sample:

http://msdn.microsoft.com/en-us/library/system.web.services.protocols.soapextension.aspx

Explanation:

http://msdn.microsoft.com/en-us/library/esw638yk(vs.71).aspx

Configuration:

http://msdn.microsoft.com/en-us/library/b5e8e7kk(v=vs.71).aspx

<configuration>
 <system.web>
   <webServices>
     <soapExtensionTypes>
      <add type="{Type name}, {Assembly}" priority="1" group="0" />
     </soapExtensionTypes>
    </webServices>
 </system.web>
</configuration>
like image 142
csharptest.net Avatar answered Sep 27 '22 18:09

csharptest.net