WCF上下文中的方法详细信息? [英] Method details in WCF context?
问题描述
如何在WCF 4.0 SOAP服务中从OperationContext.Current
获取方法详细信息(方法名称+参数名称及其值的列表)?
我正在尝试实现自己的通用诊断程序,该诊断程序可以从服务的当前调用上下文中读取所有方法的详细信息.
干杯!
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!
推荐答案
尝试以下我的CP文章: ^ ]
如果将LoggingBehavior
属性放在服务上,则应在操作的当前LoggingContext
的LoggingContextDetails
中包含这些详细信息.输入值在LoggingContext.Current.Details.Inputs
中,您可以从LoggingContext.Current.Details.MethodDetails
中提供的MethodInfo
中获取方法名称和参数.
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
.
这篇关于WCF上下文中的方法详细信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!