【问题标题】:How to add SOAP headers in Silverlight?如何在 Silverlight 中添加 SOAP 标头?
【发布时间】:2009-09-29 15:13:47
【问题描述】:

我正在尝试保护我的 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???

【问题讨论】:

    标签: silverlight-3.0 interface wcf-client dataservice custom-headers


    【解决方案1】:

    发现问题。项目中引用的System.ServiceModel.dll是针对runtime v2.0.50727,不包含较新的接口等,而不是framework v.3.x版本的dll。

    但是...现在这提出了一个新问题,这将成为它自己的问题。

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2011-08-24
    • 1970-01-01
    • 2013-01-29
    • 2011-01-20
    • 2017-04-14
    相关资源
    最近更新 更多