C# 找不到配置绑定扩展,绑定存在,但服务可以';我看不出来
我尝试过使用我能找到的所有解决方案,但一直无法让它工作。我正在尝试将本地计算机连接到连接为https的服务器。我得到的最新错误是:- 找不到配置绑定扩展“system.serviceModel/bindings/WSHttpBinding\u iSeries设备”。验证此绑定扩展是否已在system.serviceModel/extensions/bindingExtensions中正确注册,并且拼写正确 当我查看web.config时,可以在bindings部分看到WSHttpBinding\u iSeries设备。我不知道我做错了什么。我的web.config是:-C# 找不到配置绑定扩展,绑定存在,但服务可以';我看不出来,c#,wcf,C#,Wcf,我尝试过使用我能找到的所有解决方案,但一直无法让它工作。我正在尝试将本地计算机连接到连接为https的服务器。我得到的最新错误是:- 找不到配置绑定扩展“system.serviceModel/bindings/WSHttpBinding\u iSeries设备”。验证此绑定扩展是否已在system.serviceModel/extensions/bindingExtensions中正确注册,并且拼写正确 当我查看web.config时,可以在bindings部分看到WSHttpBinding\
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="baseaddress" value="https://Silvertest.Example.com/Silver"/>
</appSettings>
<connectionStrings>
<add name="" connectionString=""/>
</connectionStrings>
<system.web>
<customErrors mode="Off"/>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.DirectoryServices.AccountManagement, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
<add assembly="System.DirectoryServices, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
</assemblies>
</compilation>
<pages controlRenderingCompatibilityVersion="4.0"/>
<httpRuntime targetFramework ="4.5" />
</system.web>
<system.serviceModel>
<services>
<service name="Silver" >
<endpoint address="" binding="WSHttpBinding_IService" contract="IService" />
<host>
<baseAddresses>
<add baseAddress="https://Silvertest.Example.com/Silver/service.svc"/>
</baseAddresses>
</host>
</service >
</services>
<client>
<endpoint address="https://Silvertest.Example.com/Silver/Service.svc"
binding="WSHttpBinding" bindingConfiguration="wsHttpBinding"
contract="IService" name="SecureWCF" />
</client>
<protocolMapping>
<add scheme="https" binding="WSHttpBinding_IService" bindingConfiguration="SecureWCF" />
</protocolMapping>
<extensions>
<endpointExtensions>
</endpointExtensions>
</extensions>
<bindings>
<wsHttpBinding>
<binding name="WSHttpBinding_IService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
bypassProxyOnLocal="false" transactionFlow="false" hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288" maxReceivedMessageSize="65536" messageEncoding="Text"
textEncoding="utf-8" useDefaultWebProxy="true" allowCookies="false">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType ="None"/>
</security>
</binding>
</wsHttpBinding>
<basicHttpBinding>
<binding closeTimeout="10:01:00" openTimeout="10:01:00" receiveTimeout="00:10:00"
sendTimeout="10:01:00" allowCookies="false" bypassProxyOnLocal="false"
hostNameComparisonMode="StrongWildcard" maxBufferPoolSize="524288"
maxBufferSize="2147483647" maxReceivedMessageSize="2147483647"
textEncoding="utf-8" transferMode="Buffered" useDefaultWebProxy="true"
messageEncoding="Text">
<readerQuotas maxDepth="32" maxStringContentLength="2147483647"
maxArrayLength="16384" maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport clientCredentialType="None" />
<message/>
</security>
</binding>
<binding name="BasicHttpBinding_IRemote" />
</basicHttpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior>
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled ="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
<behavior name="SecureWCF">
<!-- To avoid disclosing metadata information, set the value below to false and remove the metadata endpoint above before deployment -->
<serviceMetadata httpGetEnabled="true" httpsGetEnabled ="true"/>
<!-- To receive exception details in faults for debugging purposes, set the value below to true. Set to false before deployment to avoid disclosing exception information -->
<serviceDebug includeExceptionDetailInFaults="true"/>
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true"/>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
您的客户端和服务器端点配置对于初学者来说是错误的。试试这个:
<endpoint address="https://Silvertest.Example.com/Silver/Service.svc"
binding="wsHttpBinding" bindingConfiguration="WSHttpBinding_IService"
contract="IService" name="SecureWCF" />
必须为服务器和客户端端点元素指定
绑定
和绑定配置
属性。确保绑定配置元素也匹配(除非您正在使用SSL卸载,但我假设您不匹配)。我按照您的建议进行了更改,但是仍然会出现相同的错误。找不到配置绑定扩展“system.serviceModel/bindings/WSHttpBinding\u iSeries设备”。请验证此绑定扩展是否已在system.serviceModel/extensions/bindingExtensions中正确注册,以及拼写是否正确。目前,我正在尝试使其在浏览器中工作,然后担心客户端。如果绑定的大小写现在正确,则可能是配置中的排序问题。检查serviceModel元素使用的顺序,如MSDN中所示:我重新组织了它,但这似乎没有任何效果,也没有改变大小写。您收到的第二条错误消息仍然表明您在binding
attribute tho'中有错误的值,必须是wsHttpBinding
才能说明绑定的类型是wsHttpBinding
bindingConfiguration
用于命名它应该使用的wsHttpBinding
子级。