作者:毛残品_394 | 来源:互联网 | 2024-10-20 18:12
问题首先来看一下项目结构如图中所示,我需要在App.config文件中配置两个服务:IBookSerivices和IWcfSvrCallBack配置的结果如下面的XML代码
问题
首先来看一下项目结构
如图中所示,我需要在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”不支持它或者因配置不正确而无法支持它。
是哪儿配置错了呢?请指点,谢谢啊!
最佳回答
将配置:
中的wsHttpBinding改成wsDualHttpBinding。
试试