如何在 Silverlight 中添加 SOAP 标头?
我正在尝试保护 Silverlight 使用的数据服务,并且正在考虑使用混淆到 SL 和 HTTPSed 中的自定义 SOAP 标头。
我发现了许多示例,展示了如何使用 IClientMessageInspector、IEndpointBehavior 和其他一些东西来执行此操作。好吧……这一切看起来都很简单。
我的问题是,当我尝试编写我的类并从 IClientMessageInspector 继承时,它不断告诉我接口未定义。我在对象资源管理器中查找了它,它说它位于 System.ServiceModel.Dispatcher 命名空间中。好的。
不过,我一生都无法让这个界面被“引用”。我添加了对 System.ServiceModel 的项目引用,并且我的代码文件中有以下导入(所有这些都表明没问题):
Imports System.ServiceModel
Imports System.ServiceModel.Description
Imports System.ServiceModel.Channels
Imports System.ServiceModel.Dispatcher
然而,当我尝试实现 IClientMessageInspector 时,它仍然告诉我它未定义,并提供将其替换为 IClientMessageFormatter 或 IClientOperationSelector。
我需要添加哪些引用/导入才能获取 IClientMessageInspector???
I'm trying to secure a data service used by my Silverlight, and am looking at using a custom SOAP header obfuscated into the SL and HTTPSed.
I've found any number of examples showing how to do this using IClientMessageInspector, IEndpointBehavior, and a few other things. Okay... it all looks straightforward enough.
My problem is though when i try to write my class, and inherit from IClientMessageInspector, it keeps telling me that the interface is not defined. I looked it up in Object Explorer, and it says it's in the System.ServiceModel.Dispatcher namespace. Okay.
I cannot for the life of me get this interface to be "referenced" though. I've added a project reference to System.ServiceModel, and i have the following imports in my code file (all of which are indicated to be okay):
Imports System.ServiceModel
Imports System.ServiceModel.Description
Imports System.ServiceModel.Channels
Imports System.ServiceModel.Dispatcher
Yet when i try to Implement IClientMessageInspector, it still tells me it's undefined, and offers to replace it with IClientMessageFormatter or IClientOperationSelector.
What references/imports do i need to add to get IClientMessageInspector???
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
发现问题了。项目中引用的System.ServiceModel.dll是针对运行时v2.0.50727的,它不包括较新的接口等,而不是框架v.3.x版本的dll。
但是……现在这提出了一个新问题,这将成为它自己的问题。
Found the problem. The System.ServiceModel.dll referenced in the project is against the runtime v2.0.50727, which does not include the newer interfaces and such, instead of the framework v.3.x version of the dll.
But... now this presents a new problem, which will become it's own question.