/// <summary> /// 构造函数 /// </summary> /// <param name="serviceUrl">服务地址</param> /// <param name="openSecurity">是否开启安全校验</param> /// <param name="wsHttpBinding">自定义绑定</param> public WcfHost(string serviceUrl = "http://127.0.0.1:14725", bool openSecurity = false, WSHttpBinding wsHttpBinding = null) { _serviceUrl = serviceUrl; OpenSecurity = openSecurity; if (wsHttpBinding == null) { _wsHttpBinding = OpenSecurity ? WcfHelper.GetDefaultBinding(true) : WcfHelper.GetDefaultBinding(false); } else { _wsHttpBinding = wsHttpBinding; } InitService(); }
private WSHttpBinding GetDefaultBinding() { return(WcfHelper.GetDefaultBinding()); }
private static Binding GetBinding(bool openSecurity) { return(WcfHelper.GetDefaultBinding(openSecurity)); }