Click here to Skip to main content
15,885,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How one can get method details (method name + list of parameter names with their values) from OperationContext.Current in WCF 4.0 SOAP service?

I'm trying to implement my own generic diagnostics that can read all the method details from the current call context of the service.

Cheers!
Posted

1 solution

Try my following CP article: LoggingBehavior - How to Connect Log-prints with the WCF Operation's Details, using a Simple Behavior[^]


If you put the LoggingBehavior attribute on your service, you should have those details in the LoggingContextDetails of the operation's current LoggingContext. The input values are in LoggingContext.Current.Details.Inputs and, you can get the method name and parameters from the MethodInfo that is provided in LoggingContext.Current.Details.MethodDetails.

 
Share this answer
 
v3
Comments
Vitaly Tomilov 14-Nov-12 9:07am    
That's a long read. And even after going through it (I saw your article earlier), I'm not clear how do I get a list of inputs with values? Can you simplify and just answer my question here?
Shmuel Zang 14-Nov-12 9:28am    
See the updated solution.
Vitaly Tomilov 15-Nov-12 8:51am    
Thank you. It seemed a little overhead though. I had only 8 service methods that needed to report the list of parameters and values in them. In the end I settled for simply enumerating using keyword params, and then processing them in a generic way.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900