【问题标题】:Unrecognized attribute 'defaultAlgorithmSuite'无法识别的属性“defaultAlgorithmSuite”
【发布时间】:2016-04-26 14:04:51
【问题描述】:

我在尝试创建 Web 服务客户端实例时收到异常。消息是“无法识别的属性‘defaultAlgorithmSuite’。请注意,属性名称区分大小写”。该应用程序是基于 .NET Framework 4.5 的 MVC 5,正在 Visual Studio 2015 的 IIS Express 中进行调试。相同的代码正在另一个具有相同属性的应用程序中工作。 Web.config 中的语法验证无法识别服务绑定配置中的标签安全性中的属性。

<system.serviceModel>
    <bindings>
      <basicHttpBinding>
        <binding name="BasicHttpBinding_MaxValueRecovery" allowCookies="true" maxReceivedMessageSize="20000000" maxBufferSize="20000000" maxBufferPoolSize="20000000">
          <readerQuotas maxDepth="32" maxArrayLength="200000000" maxStringContentLength="200000000" />
        </binding>
        <binding name="CustomBinding_IMyService">
          <security defaultAlgorithmSuite="Default"
                    authenticationMode="UserNameOverTransport"
                    requireDerivedKeys="true"
                    includeTimestamp="true"
                    messageSecurityVersion="WSSecurity11WSTrustFebruary2005WSSecureConversationFebruary2005WSSecurityPolicy11BasicSecurityProfile10"
                    allowInsecureTransport="true"
                    enableUnsecuredResponse="true">
            <localClientSettings detectReplays="false" />
            <localServiceSettings detectReplays="false" />
          </security>
          <textMessageEncoding messageVersion="Soap12" />
          <httpTransport />
        </binding>
      </basicHttpBinding>
    </bindings>
    <client>
      <endpoint address="http://.../MyService.svc"
            binding="customBinding" bindingConfiguration="CustomBinding_IMyService"
            contract="MyNamespace.IMyService" name="CustomBinding_IMyService" />
    </client>
</system.serviceModel>

我错过了什么或做错了什么?谢谢...

【问题讨论】:

    标签: c# web-services wcf


    【解决方案1】:

    您不小心尝试将自定义绑定配置为 BasicHttpBinding。移动

    <binding name="CustomBinding_IMyService"> ... </binding>
    

    阻止&lt;basicHttpBinding&gt;&lt;customBinding&gt; 父级:

    <bindings>
        <basicHttpBinding>
            <binding name="BasicHttpBinding_MaxValueRecovery" ...>
            ...
            </binding>
        </basicHttpBinding>
        <customBinding>
            <binding name="CustomBinding_IMyService">
            ...
            </binding>
        </customBinding>
    </bindings>
    

    您要配置的安全选项are only supported on a custom binding

    【讨论】:

      猜你喜欢
      • 2012-08-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-10
      相关资源
      最近更新 更多