Click here to Skip to main content
13,259,427 members (80,126 online)
Rate this:
Please Sign up or sign in to vote.
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.

Posted 14-Nov-12 3:14am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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.

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)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy |
Web03 | 2.8.171114.1 | Last Updated 14 Nov 2012
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100