WCF上下文中的方法详细信息? [英] Method details in WCF context?

查看:81
本文介绍了WCF上下文中的方法详细信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在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属性放在服务上,则应在操作的当前LoggingContextLoggingContextDetails中包含这些详细信息.输入值在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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆