首先来看一下项目结构
如图中所示,我需要在App.config文件中配置两个服务:IBookSerivices和IWcfSvrCallBack
配置的结果如下面的XML
<services>
<service behaviorConfiguration="services_first.Service1Behavior"
name="services_first.BookServices">
<endpoint address="" binding="wsHttpBinding" contract="services_first.IBookservices">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/Design_Time_Addresses/services_first/Service1/" />
</baseAddresses>
</host>
</service>
<service behaviorConfiguration="services_first.Service1Behavior"
name="services_first.WCFSvrCallBack">
<endpoint binding="wsHttpBinding" bindingConfiguration="" contract="services_first.IWCFSvrCallUser" />
<host>
<baseAddresses>
<add baseAddress="http://localhost:8731/Design_Time_Addresses/services_first/Service1/" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
System.InvalidOperationException: 协定需要双工,但是绑定“WSHttpBinding”不支持它或者因配置不正确而无法支持它。
是哪儿配置错了呢?请指点,谢谢啊!
将配置: <endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary1.IService1">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
中的wsHttpBinding改成wsDualHttpBinding。
试试
遇到同样的问题,LZ这个问题解决没有!