【发布时间】:2011-05-26 19:18:28
【问题描述】:
我的 Silverlight 解决方案中定义了一个 WCF 服务项目。该解决方案由三个项目组成。
- MySilverLightApplication [the Silverlight 应用]
- MySilverLightApplication.Web [网络 托管它的项目]
- 我的WCF服务
我想在 Silverlight 应用程序和 WCF 服务之间建立安全连接,因此我通过编辑服务项目的 web.config 文件在服务端打开了wsHttpBinding,如下所示:
<services>
<service name="ExternalWcfService.extService"
behaviorConfiguration="ExternalWCF">
<endpoint address="" binding="wsHttpBinding"
contract="ExternalWcfService.IextService"/>
<endpoint address="mex" binding="mexHttpBinding"
contract="IMetadataExchange"/>
</service>
</services>
当我在 SL 客户端中添加对此服务的引用时,我在 Silverlight 应用程序的 ServiceReferences.ClientConfig 文件中没有输入任何内容。为什么会这样?然后当我运行应用程序时,我收到如下错误:
找不到默认端点 引用合约的元素 'ExternalWCFService.IextService' 在 ServiceModel 客户端配置 部分。这可能是因为没有 为您找到了配置文件 应用程序,或者因为没有端点 与本合同相匹配的元素可以 可以在客户端元素中找到。
我在 Silverlight 根文件夹中有 silverlight.config 文件。为什么没有在 SL 项目中创建端点?
【问题讨论】:
标签: wcf security silverlight-4.0