SmartDeviceProxy.cs 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. 
  2. using System;
  3. using Curtain.Log;
  4. using Curtain.WCF.Proxy;
  5. using Dongke.IBOSS.PRD.WCF.Contracts;
  6. namespace PLC_S.Proxy
  7. {
  8. public class SmartDeviceProxy : WCFProxy<ISmartDevice>
  9. {
  10. public SmartDeviceProxy()
  11. : base("endpoint_SmartDevice", (string)null, "SmartDeviceService")
  12. {
  13. }
  14. public SmartDeviceProxy(WCFProxySetting setting)
  15. : base("endpoint_SmartDevice", setting, "SmartDeviceService")
  16. {
  17. }
  18. public SmartDeviceProxy(string settingName)
  19. : base("endpoint_SmartDevice", settingName, "SmartDeviceService")
  20. {
  21. }
  22. private static SmartDeviceProxy _instance = null;
  23. /// <summary>
  24. /// 默认代理
  25. /// </summary>
  26. public static SmartDeviceProxy Instance
  27. {
  28. get
  29. {
  30. if (_instance == null)
  31. {
  32. _instance = new SmartDeviceProxy();
  33. }
  34. return _instance;
  35. }
  36. }
  37. protected override Exception InvokeException(string methodName, Exception ex)
  38. {
  39. Logger.Error(ex, methodName, "MES");
  40. return null;
  41. //return ex;
  42. }
  43. //protected override TResult InvokeDone<TResult>(string methodName, TResult result, bool isOneWay = false)
  44. //{
  45. // return result;
  46. // return Commons.InvokeDone(methodName, result, isOneWay);
  47. //}
  48. }
  49. }