WCF紧凑框架上的拦截器 [英] WCF Interceptor On Compact Framework

查看:275
本文介绍了WCF紧凑框架上的拦截器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的WCF服务中添加一个拦截器层,以发送设备ID来对设备进行身份验证.

I would like to add an interceptor layer to my WCF service to send the Device ID to authenticate the device.

我对WCF拦截器非常陌生.在花所有时间弄清楚它们之前,我想知道它们是否甚至可以与Compact Framework一起使用.

I am very very new to WCF Interceptors. Before I take all the time to figure them out, I would like to know if they even work with the Compact Framework.

因此,WCF拦截器是否可以与Compact Framework一起使用,如果可以,在研究它们时,我需要牢记一些特殊的注意事项. (任何执行此操作的C#示例都很棒!)

So, do WCF Interceptors work with the Compact Framework and if so are there any special considerations I need to keep in mind as I research them. (Any C# examples of how to do this would be AWESOME!)

我正在使用Visual Studio 2008 SP1.

I am using Visual Studio 2008 SP1.

推荐答案

无法在WCF for Compact Framework(NETCF)上创建拦截器. NETCF中不存在IClientMessageInspector和拦截器所需的类似构造.

Interceptors cannot be created on WCF for Compact Framework (NETCF). The IClientMessageInspector and similar constructs needed for interceptors are not present in NETCF.

您可以添加自定义的肥皂标题.您只需要将它们添加到每个WCF服务调用中即可.

You can add custom soap headers though. You just have to add them to each WCF Service Call.

这篇关于WCF紧凑框架上的拦截器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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