报错信息:协定需要双工,但是绑定“BasicHttpBinding”不支持它或者因配置不正确而无法支持它。怀疑:难道是IIS宿主不支持多种不同的binding?服务端配置web.config<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="webbehavior">
 <serviceMetadata httpGetEnabled="true" />
 <serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<serviceHostingEnvironment multipleSiteBindingsEnabled="true" />
<services>
<service behaviorConfiguration="webbehavior" name="nt.web.WCF.User">
<host>
<baseAddresses>
<add baseAddress="http://192.168.0.212:1912/WCF/"/>
</baseAddresses>
</host>
<endpoint binding="basicHttpBinding" contract="nt.WcfContract.IUser" name="user_contract" address="User.svc"></endpoint>
</service>
<service behaviorConfiguration="webbehavior" name="nt.web.WCF.Communication">
<host>
<baseAddresses>
<add baseAddress="http://192.168.0.212:1912/WCF/"/>
</baseAddresses>
</host>
<endpoint binding="wsDualHttpBinding" contract="nt.WcfContract.ICommunicationContract" name="user_communication" address="Communication.svc"></endpoint>
</service>
</services>
</system.serviceModel>
服务端契约[ServiceContract(CallbackContract = typeof(IServerCallback))]
    public interface ICommunicationContract
    {
        [OperationContract(IsOneWay = true)]
        void HeartBeat(Model_User user);        [OperationContract(IsOneWay = true)]
        void LoginOut();
    }
契约实现[ServiceBehavior(ConcurrencyMode = ConcurrencyMode.Multiple, ConfigurationName = "user_communication")]
    public class Communication : ICommunicationContract
    {
        
        public void HeartBeat(WCFModel.Model_User user)
        {
            //Logic_DesktopUser.UserHeartBeat(user);        }        public void LoginOut()
        {
            //Logic_DesktopUser.LoginOut(user);
            var callback = OperationContext.Current.GetCallbackChannel<nt.WcfContract.IServerCallback>();
            callback.CallBack();        }
    }
客户端调用DuplexChannelFactory<nt.WcfContract.ICommunicationContract> duplex = new DuplexChannelFactory<ICommunicationContract>(new InstanceContext(new ServerCallback()), "user_communication");
            var bll = duplex.CreateChannel();
            bll.LoginOut();
WCFC#asp.netiis