将安全绑定添加到wcf端点

时间:2013-01-18 08:53:43

标签: wcf wcf-security

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

<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中的标头。

有人能指出我正确配置的方向吗?

谢谢, 马特

2 个答案:

答案 0 :(得分:0)

您忘了设置bindingConfiguration

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

答案 1 :(得分:0)

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

检查WCF绑定上的this link