WCF Interceptor On Compact Framework

旧巷老猫 提交于 2020-01-06 08:26:21

问题


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

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.

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!)

I am using Visual Studio 2008 SP1.


回答1:


I haven't used WCF myself, but a quick glance at this article shows me you need the IChannelFactory and/or IChannelListener classes which are supported on .NET CF 3.5.

The article also has a downloadable sample app, which you probably can modify to run on .NET CF.

So I can't give you any considerations or gotchas, but it looks to me you won't be on a dead end road here.




回答2:


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

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



来源:https://stackoverflow.com/questions/2050554/wcf-interceptor-on-compact-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!