我创建了一个wcf服务,但是当我尝试更新服务引用时,它总是会给出这个异常,“Contract需要Duplex,但Binding'BasicHttpBinding'不支持它,或者没有正确配置以支持它。”
以下是我的web.config文件
<?xml version="1.0"?>
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0" />
</system.web>
<system.serviceModel>
<bindings>
<wsDualHttpBinding>
<binding name="myBinding" clientBaseAddress="http://localhost:18528/BankService/Service.svc">
<security mode="None"/>
</binding>
</wsDualHttpBinding>
</bindings>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true">
<baseAddressPrefixFilters>
<add prefix="http://localhost:18528/BankService/Service.svc"/>
</baseAddressPrefixFilters>
</serviceHostingEnvironment>
<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"/>
<!-- 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="false"/>
<dataContractSerializer maxItemsInObjectGraph="999999999"/>
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="BankService">
<endpoint address="" binding="wsDualHttpBinding" contract="BankService.IBankService" bindingConfiguration="myBinding"
name="HttpEndPoint">
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"/>
</service>
</services>
</system.serviceModel>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
由于我已经指定了一个wsDualHttpBinding,当我尝试更新服务引用时它仍然会出现此异常。
当我在整个解决方案中查找“BasicHttpBinding”关键字时,我在configuration.svcinfo和configuration91.svcinfo中找到它们。
任何机构都可以给我解决方案,谢谢。