WCF服务调用包装 [英] WCF Service Call Wrapper

查看:142
本文介绍了WCF服务调用包装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

什么是用于创建包装WCF服务电话的最佳实践?我觉得还是有必要  监测在同一个地方所有的呼叫,我想用这种code,这是正确的想法?

What is best practice for creating wrapper for WCF service call? I think it is necessary to monitor all calls in the same place, I am thinking to use this kind of code, is this right idea?

RetType t = ServiceExecutionContext<IServiceChanel>.Execute(s=>s.GetServiceMethod());


包装什么样的,你在企业应用程序中使用?
非常感谢!


What kind of wrapper are you use in your enterprise applications?
Thanks a lot!

推荐答案

WCF有一个模型,可以让你在服务调用链。我会用了,而不是试图总结每一次服务电话,如果所有你想要做的是一些日志记录(如果您打开诊断上的配置文件,该文件WCF已经是非常善于做),共同类似的事情在你的服务呼叫。

WCF has a model that allows you to be in the service call chain. I would use that rather than trying to wrap every service call if all that you are trying to do is some logging (which WCF is already very good at doing if you turn diagnostics on in the config file) and common things like that around your service calls.

下面是有关如何为WCF服务创建自定义行为一个很好的MSDN文章

这篇关于WCF服务调用包装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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