InvokeService.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using System.Reflection;
  3. using System.ServiceModel;
  4. using Aitex.Core.RT.Log;
  5. using Aitex.Core.RT.OperationCenter;
  6. namespace MECF.Framework.Common.OperationCenter
  7. {
  8. [ServiceBehavior(InstanceContextMode = InstanceContextMode.Single, ConcurrencyMode = ConcurrencyMode.Multiple)]
  9. public class InvokeService : IInvokeService
  10. {
  11. public void DoOperation(string operationName, params object[] args)
  12. {
  13. try
  14. {
  15. //if (KeyManager.Instance.IsExpired)
  16. //{
  17. // EV.PostMessage("System", EventEnum.DefaultWarning, "Software is expired. Can not do the operation");
  18. // return;
  19. //}
  20. string argsList = "";
  21. if (args.Length > 0)
  22. {
  23. foreach (object arg in args)
  24. {
  25. argsList += (" " + arg.ToString());
  26. }
  27. }
  28. LOG.WriteLog(eEvent.EV_DEVICE_INFO, "", $"{operationName} was execute,parameter :{argsList}");
  29. OP.DoOperation(operationName, args);
  30. }
  31. catch (Exception ex)
  32. {
  33. LOG.WriteExeption(string.Format("调用{0},碰到未处理的WCF操作异常", operationName), ex);
  34. }
  35. }
  36. }
  37. }