【发布时间】: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