【问题标题】:adding security binding to a wcf end point将安全绑定添加到 wcf 端点
【发布时间】:2013-01-18 08:53:42
【问题描述】:

我在下面的配置中添加了一个绑定:

<services> 
  <service name="MyNamespace.Service.ServiceName.ServiceEndPoint"> 
    <endpoint address="http://localhost:8012/ServiceEndPoint" binding="webHttpBinding" contract="MyNamespace.Service.ServiceName.IServiceEndPoint" behaviorConfiguration="webHttp" name="ServiceName"/>

  </service> 
</services> 
<behaviors> 
  <endpointBehaviors> 
    <behavior name="webHttp"> 
      <webHttp/> 
    </behavior> 
  </endpointBehaviors> 
</behaviors>

所以我添加了 binding="webHttpBinding" 因为我想保护端点。这是我拥有的相应配置:

<bindings> 
  <wsHttpBinding> 
    <binding name="ServiceName"> 
      <security mode="Transport"> 
        <transport clientCredentialType="Windows" /> 
      </security> 
    </binding> 
  </wsHttpBinding> 
</bindings>

但这似乎无法保护终点。我已经用 Firefox 尝试过这个,以确认 IE 没有自动验证并检查了 firebug 中的标题。

任何人都可以为我指出正确的配置方向吗?

谢谢, 马特

【问题讨论】:

    标签: wcf wcf-security


    【解决方案1】:

    你忘记设置bindingConfiguration

    <endpoint address="http://localhost:8012/ServiceEndPoint" binding="webHttpBinding" contract="MyNamespace.Service.ServiceName.IServiceEndPoint" behaviorConfiguration="webHttp" name="ServiceNameEndpoint" bindingConfiguration="ServiceName"/>
    

    【讨论】:

      【解决方案2】:

      在您的绑定中,您已经配置了wsHttpBinding,并且在您的服务端点中,您已经指定了webHttpBinding。我认为您希望将端点绑定设置为wsHttpBinding。

      检查 WCF 绑定上的 this link。

      【讨论】:

        猜你喜欢
        • 2011-03-14
        • 2020-06-19
        • 1970-01-01
        • 2012-03-08
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2012-12-02
        相关资源
        最近更新 更多