WCFControl.cs
1.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
using log4net;
using OnlineStore.Common;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.ServiceModel;
using System.Text;
namespace OnlineStore.ACSingleStore
{
public class WCFControl
{
//public static bool isRun=false;
//public static readonly ILog LOGGER = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
//private static ServiceHost host = null;
//public static void OpenWCF()
//{
// if (isRun)
// {
// return;
// }
// try
// {
// if (host == null)
// {
// host = new ServiceHost(typeof(AcStoreWCF.CWSMDBox));
// }
// if (host.State != CommunicationState.Opening)
// {
// host.Open();
// }
// isRun = true;
// LogUtil.info("打开WCF服务成功");
// }
// catch (Exception ex)
// {
// LogUtil.error("打开WCF服务出错:" + ex.ToString());
// }
//}
//public static void CloseWCF()
//{
// try
// {
// isRun = false;
// if (host != null)
// {
// host.Close();
// }
// LogUtil.info("关闭WCF服务成功");
// }
// catch (Exception ex)
// {
// LogUtil.error("关闭WCF服务出错:" + ex.ToString());
// }
//}
}
}