【发布时间】:2012-12-28 05:31:28
【问题描述】:
我有一个自定义的用户名密码 WCF 服务,需要由 Windows 客户端(Winforms 应用程序)以及 Web 客户端(html/aspx 页面)调用。我在 web.config 中有两个端点声明,但为了使其正常工作,我必须对其中一个进行注释,因此,只有与该未注释端点关联的客户端类型才能访问该服务。如果我取消评论,并评论另一个,其他客户可以访问它。我无法同时保留它们,因此我无法使用这两种类型的客户端访问它。
<service behaviorConfiguration="Behavior1" name="BeST.Service.Service">
<endpoint address="" binding="webHttpBinding" contract="BeST.Service.IService" behaviorConfiguration="EndpBehavior"></endpoint>
<endpoint address="" binding="wsHttpBinding" bindingConfiguration="Binding1"
contract="BeST.Service.IService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost/" />
</baseAddresses>
</host>
</service>
正如代码所示,如果我想让这个服务为两个客户端工作,或者如果有其他方法可以完成,我需要使用两个端点(两个端点之上),请帮助!
【问题讨论】:
标签: wcf web-config wcf-binding