Пример #1
0
 /// <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();
 }
Пример #2
0
 private static Binding GetBinding(bool openSecurity)
 {
     return(WcfHelper.GetDefaultBinding(openSecurity));
 }
Пример #3
0
 private WSHttpBinding GetDefaultBinding()
 {
     return(WcfHelper.GetDefaultBinding());
 }