예제 #1
0
        /// <summary>
        /// 校验业务系统或者获取业务系统数据
        /// </summary>
        public void Process()
        {
            var arg = this.Args as AsyncDistributionArgs;

            if( arg == null ) {
                return;
            }
            string message = string.Empty;
            foreach( DataRow dr in arg.Data ) {
                string serviceInfoID = serviceInfoID = dr["ServiceInfoID"].ToString();
                string methodName = methodName = dr["MethodName"].ToString();

                try {
                    Utility.Logger.WriteLog(LogLevel.Info, "一次实时分发开始执行"
                    , String.Format("服务信息ID为:{0};接口名称为{1};", serviceInfoID, methodName));

                    var soapResult = new InboundHandler().Request(serviceInfoID, methodName, dr["Content"].ToString());
                    this.Result = Receive.BuildSoapResult(soapResult.ResultString, ref message);

                    Utility.Logger.WriteLog(this.Result ? LogLevel.Info : LogLevel.Alert, "一次实时分发执行完毕",
                    String.Format("服务信息ID为:{0};接口名称为{1};返回消息为:{2}", serviceInfoID, methodName, message));

                    // 更新分发作业状态
                    arg.Action(new Guid(dr["DistributionTaskId"].ToString()), this.Result, message);
                }
                catch( Exception exception ) {
                    Utility.Logger.WriteLog(this.Result ? LogLevel.Info : LogLevel.Alert, "一次实时分发执行完毕",
                 String.Format("服务信息ID为:{0};接口名称为{1};返回消息为:{2}", serviceInfoID, methodName, message), exception);
                    arg.Action(new Guid(dr["DistributionTaskId"].ToString()), false, exception.ToString());
                }
            }
            this.Result = true;
        }
예제 #2
0
        /// <summary>
        /// 校验业务系统或者获取业务系统数据
        /// </summary>
        public void Process()
        {
            var arg = this.Args as AsyncReceiveArgs;

            if( arg == null ) {
                return;
            }

            string message = string.Empty;
            string serviceInfoID = string.Empty;
            string methodName = string.Empty;
            try {
                serviceInfoID = arg.Data["ServiceInfoID"].ToString();
                methodName = arg.Data["MethodName"].ToString();
                Utility.Logger.WriteLog(LogLevel.Info, "一次实时获取或者校验接口开始执行"
                    , String.Format("服务信息ID为:{0};接口名称为{1};", serviceInfoID, methodName));
                var soapResult = new InboundHandler().Request(serviceInfoID, methodName, arg.Content);

                this.Result = Receive.BuildSoapResult(soapResult.ResultString, ref message);
                this.Message = message;

                Utility.Logger.WriteLog(this.Result ? LogLevel.Info : LogLevel.Alert, "一次实时获取或者校验接口执行完毕",
                    String.Format("服务信息ID为:{0};接口名称为{1};返回消息为:{2}", serviceInfoID, methodName, message));

            }
            catch( Exception exception ) {
                this.Result = false;
                this.Message = exception.ToString();
                Utility.Logger.WriteLog(LogLevel.Error, "一次实时获取或者校验接口执行失败",
                String.Format("服务信息ID为:{0};接口名称为{1};返回消息为:{2}", serviceInfoID, methodName, message), exception);
            }
        }