Ejemplo n.º 1
0
        public static void ExecuteMethod(string method, string productName, Action <ResponseMessage> callback)
        {
            ResponseMessage responseMsg = null;

            if (IsDebugEnabled)
            {
                log.Debug("정보를 조회합니다... method=[{0}]", method);
            }


            try {
                var requestMsg = new RequestMessage();
                requestMsg.AddItem(method, ResponseFormatKind.ResultSet);

                using (var dataService = new NSoft.NFramework.DataServices.Clients.WebDataService.DataService()) {
                    responseMsg = ClientTool.Execute(dataService, requestMsg, ProductName);
                }
            }
            catch (Exception ex) {
                if (log.IsErrorEnabled)
                {
                    log.ErrorException("서버에 DataService 요청을 처리하는데 예외가 발생했습니다.", ex);
                }
                throw;
            }
            if (callback != null)
            {
                callback(responseMsg);
            }
        }
Ejemplo n.º 2
0
        public static void ExecuteMethod(string method, string productName, Action<ResponseMessage> callback) {
            ResponseMessage responseMsg = null;

            if(IsDebugEnabled)
                log.Debug("정보를 조회합니다... method=[{0}]", method);


            try {
                var requestMsg = new RequestMessage();
                requestMsg.AddItem(method, ResponseFormatKind.ResultSet);

                using(var dataService = new NSoft.NFramework.DataServices.Clients.WebDataService.DataService()) {
                    responseMsg = ClientTool.Execute(dataService, requestMsg, ProductName);
                }
            }
            catch(Exception ex) {
                if(log.IsErrorEnabled)
                    log.ErrorException("서버에 DataService 요청을 처리하는데 예외가 발생했습니다.", ex);
                throw;
            }
            if(callback != null)
                callback(responseMsg);
        }