Wcf 客户端身份验证方案禁止HTTP请求';匿名';关于wsDualHttpBinding

Wcf 客户端身份验证方案禁止HTTP请求';匿名';关于wsDualHttpBinding,wcf,app-config,wsdualhttpbinding,transport-security,Wcf,App Config,Wsdualhttpbinding,Transport Security,我有一个客户机-服务器应用程序。我的服务器站点位于IIS上。 我的客户端App.config是: <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.serviceModel> <bindings> <wsDualHttpBinding> <binding name="WSDu

我有一个客户机-服务器应用程序。我的服务器站点位于IIS上。
我的客户端App.config是:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <system.serviceModel>
        <bindings>
            <wsDualHttpBinding>
                <binding name="WSDualHttpBinding_IService" />
            </wsDualHttpBinding>
        </bindings>
        <client>
            <endpoint address="http://localhost:8083/Service.svc"                  
                      binding="wsDualHttpBinding"
                      bindingConfiguration="WSDualHttpBinding_IService"    
                      contract="ServiceReference.IService"
                      name="WSDualHttpBinding_IService">
            </endpoint>
        </client>
   </system.serviceModel>

当我按下应用程序上的一个按钮时,会出现以下错误:

客户端身份验证方案“匿名”未授权http请求。

似乎为了解决此问题,我必须使用以下代码:

<security mode="TransportCredentialOnly">
  <transport clientCredentialType="Windows" proxyCredentialType="None" realm="" />
  <message clientCredentialType="UserName" algorithmSuite="Default" />
</security>

但是,既然wsDualHttpBinding不支持传输安全性,我该怎么办?

可能IIS本身有任何声明吗?

Hi Tali B,这个问题解决了吗?因为我也面临同样的问题“HTTP请求被禁止”,但我并非总是遇到这个错误。但不确定问题是否是因为安全模式未设置为“无”。