Hi,
Im wondering how you can capture the arguments of a WebService call dynamicly(for logging).
Is there any property that stores the Arguments of the call being made?
Hi,
Im wondering how you can capture the arguments of a WebService call dynamicly(for logging).
Is there any property that stores the Arguments of the call being made?
One way i've stored what's coming into a web service is to store in a database. It was a .NET webservice that got data from db via a stored procedure, in the stored proc I just used an INSERT INTO statement to store what was passed in.
what about enabling tracing via the diagnostics element in web.config? this is probably more for debug purposes though.
<microsoft.web.services>
<diagnostics>
<trace enabled="true" input="inputTrace.config" output="outputTrace.config"/>
</diagnostics>
</microsoft.web.services>
It would depend on the type of logging and the type of web service you are using. It also depends on what you want to finally do with this information. (reporting? statistics? debugging?)
It also depends on where you want to capture the web service parameters. You could log them from the invoking application, or you could log them directly in the web service, depending on the architecture of your application and network. You could store the parameter information in a log on the web server (which could potentially affect the performance of the web server), or you could log the parameters locally, within the application and process that information from there.
Assuming you are using Windows Communication Foundation for your web service(s), you could create a client message inspector to capture the inbound communication and parse out the parameters and store them into a database table. The interfaces that you'd need to handle are IEndpointBehavior and IClientMessageInspector. After creating that, you could attach it as a behavior to one of your endpoints in the web.config file and that should do it.