Beispiel #1
0
        public MessageReceiveResponse MessageReceive(MessageReceiveRequest request)
        {
            MessageReceiveResponse response = new MessageReceiveResponse();

            if (WA.Standard.IF.Logger.Log.Log.RunningMode.Equals(WA.Standard.IF.Data.v2.Common.Common.RunningMode.Mapper))
            {
                #region For Mapper Process

                switch (request.MessageReceive.MessageType)
                {
                    case "Appointment":
                        WA.Standard.IF.Biz.v2.Common.Appointment_Biz biz = new Appointment_Biz();

                    //Get Appointment By AppointmentNo
                        break;
                    case "Employee": //Get Employee By EmployeeNo
                        break;
                    case "Job": //Get Job By JobNo
                        break;
                    case "RepairOrder"://Get RepairOrder By RepairOrderNo
                        break;
                    default:
                        break;
                }

                #endregion
            }
            else if (WA.Standard.IF.Logger.Log.Log.RunningMode.Equals(WA.Standard.IF.Data.v2.Common.Common.RunningMode.XMLDMS))
            {
                response.TransactionHeader = request.TransactionHeader;

                #region For XML Process
                response.ResultMessage = GetResultMessageData(ResponseCode.Success, ResponseMessage.Success);
                #endregion
            }
            else if (WA.Standard.IF.Logger.Log.Log.RunningMode.Equals(WA.Standard.IF.Data.v2.Common.Common.RunningMode.DBDMS))
            {
                #region For DB Process - Not Yet
                response.ResultMessage = GetResultMessageData(ResponseCode.Success, ResponseMessage.Success);
                #endregion
            }

            return response;
        }
Beispiel #2
0
        public MessageReceiveResponse MessageReceive(MessageReceiveRequest request)
        {
            MessageReceiveResponse response = new MessageReceiveResponse();

            try
            {
                //Request body-header object validation
                response.Errors = GetErrorDataListFromRequestTransactionHeader(request.TransactionHeader);
                if (response.Errors != null)
                {
                    response.TransactionHeader = new Data.v2.Common.Common.TransactionHeader();
                    return response;
                }
                response.Errors = GetErrorDataListFromRequest(request.MessageReceive);
                if (response.Errors != null)
                {
                    response.TransactionHeader = request.TransactionHeader;
                    return response;
                }

                WS_Notification_v2.MessageReceiveRequest ws_request = new WS_Notification_v2.MessageReceiveRequest();

                #region//TransactionHeader
                WS_Notification_v2.TransactionHeader ws_transactionheader = new WS_Notification_v2.TransactionHeader();
                ws_transactionheader.CountryID = request.TransactionHeader.CountryID;
                ws_transactionheader.DealerID = request.TransactionHeader.DealerID;
                ws_transactionheader.DistributorID = request.TransactionHeader.DistributorID;
                ws_transactionheader.DMSCode = request.TransactionHeader.DMSCode;
                ws_transactionheader.DMSServerUrl = request.TransactionHeader.DMSServerUrl;
                ws_transactionheader.DMSVersion = request.TransactionHeader.DMSVersion;
                ws_transactionheader.DocumentVersion = request.TransactionHeader.DocumentVersion;
                ws_transactionheader.GroupID = request.TransactionHeader.GroupID;
                ws_transactionheader.IneterfaceID = request.TransactionHeader.IneterfaceID;
                ws_transactionheader.Password = request.TransactionHeader.Password;
                ws_transactionheader.PollingToken = request.TransactionHeader.PollingToken;
                ws_transactionheader.RequestPollingToken = request.TransactionHeader.RequestPollingToken;
                ws_transactionheader.RequestType = request.TransactionHeader.RequestType;
                ws_transactionheader.TransactionDateTimeLocal = request.TransactionHeader.TransactionDateTimeLocal;
                ws_transactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeUTC;
                ws_transactionheader.TransactionId = request.TransactionHeader.TransactionId;
                ws_transactionheader.TransactionType = request.TransactionHeader.TransactionType;
                ws_transactionheader.Username = request.TransactionHeader.Username;
                ws_transactionheader.VenderTrackingCode = request.TransactionHeader.VenderTrackingCode;
                ws_request.TransactionHeader = ws_transactionheader;
                #endregion

                #region//MessageReceive
                WS_Notification_v2.MessageReceive ws_messagereceive = new WS_Notification_v2.MessageReceive();
                ws_messagereceive.ActionType = request.MessageReceive.ActionType;
                ws_messagereceive.MessageID = request.MessageReceive.MessageID;
                ws_messagereceive.MessageType = request.MessageReceive.MessageType;
                ws_request.MessageReceive = ws_messagereceive;
                #endregion

                ws_notification = new WS_Notification_v2.Notification();
                ws_notification.ReceiverAsync(ws_request);

                response.TransactionHeader = request.TransactionHeader;
                response.ResultMessage = new Data.v2.Common.Common.ResultMessage() {
                    Code = WA.Standard.IF.Data.v2.Common.Common.ResponseCode.Success,
                    Message = WA.Standard.IF.Data.v2.Common.Common.ResponseMessage.Success };
            }
            catch (Exception ex)
            {
                response.Errors = GetErrorDataListFromException(ex);
                WA.Standard.IF.Logger.Log.Log.RootLogger.ErrorFormat("MessageReceiveResponse Error {0}: ", ex);
            }

            return response;
        }
Beispiel #3
0
        public MessageReceiveResponse MessageReceive(MessageReceiveRequest request)
        {
            MessageReceiveResponse response = new MessageReceiveResponse();

            try
            {
                WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "WA MessageReceiveRequest XML", request);

                //Request body-header object validation
                response.Errors = GetErrorDataListFromRequestTransactionHeader(request.TransactionHeader);
                if (response.Errors != null)
                {
                    response.TransactionHeader = new Data.v2.Common.Common.TransactionHeader();
                }
                response.Errors = GetErrorDataListFromRequest(request.MessageReceive);
                if (response.Errors != null)
                {
                    response.TransactionHeader = request.TransactionHeader;
                }

                if (response.Errors == null)
                {
                    WS_Notification_v2.MessageReceiveRequest proxyrequest = new WS_Notification_v2.MessageReceiveRequest();

                    #region//TransactionHeader
                    WS_Notification_v2.TransactionHeader transactionheader = new WS_Notification_v2.TransactionHeader();
                    transactionheader.CountryID = request.TransactionHeader.CountryID;
                    transactionheader.DealerID = request.TransactionHeader.DealerID;
                    transactionheader.DistributorID = request.TransactionHeader.DistributorID;
                    transactionheader.DMSCode = request.TransactionHeader.DMSCode;
                    transactionheader.DMSServerUrl = request.TransactionHeader.DMSServerUrl;
                    transactionheader.DMSVersion = request.TransactionHeader.DMSVersion;
                    transactionheader.DocumentVersion = request.TransactionHeader.DocumentVersion;
                    transactionheader.GroupID = request.TransactionHeader.GroupID;
                    transactionheader.IneterfaceID = request.TransactionHeader.IneterfaceID;
                    transactionheader.Password = request.TransactionHeader.Password;
                    transactionheader.PollingToken = request.TransactionHeader.PollingToken;
                    transactionheader.RequestPollingToken = request.TransactionHeader.RequestPollingToken;
                    transactionheader.RequestType = request.TransactionHeader.RequestType;
                    transactionheader.TransactionDateTimeLocal = request.TransactionHeader.TransactionDateTimeLocal;
                    transactionheader.TransactionDateTimeUTC = request.TransactionHeader.TransactionDateTimeUTC;
                    transactionheader.TransactionId = request.TransactionHeader.TransactionId;
                    transactionheader.TransactionType = request.TransactionHeader.TransactionType;
                    transactionheader.Username = request.TransactionHeader.Username;
                    transactionheader.VenderTrackingCode = request.TransactionHeader.VenderTrackingCode;
                    proxyrequest.TransactionHeader = transactionheader;
                    #endregion

                    #region//MessageReceive
                    WS_Notification_v2.MessageReceive messagereceive = new WS_Notification_v2.MessageReceive();
                    messagereceive.ActionType = request.MessageReceive.ActionType;
                    messagereceive.MessageID = request.MessageReceive.MessageID;
                    messagereceive.MessageType = request.MessageReceive.MessageType;
                    proxyrequest.MessageReceive = messagereceive;
                    #endregion

                    WS_Notification_v2.Notification wa_request = new WS_Notification_v2.Notification();
                    wa_request.ReceiverAsync(proxyrequest);

                    response.TransactionHeader = request.TransactionHeader;
                    response.ResultMessage = new Data.v2.Common.Common.ResultMessage()
                    {
                        Code = WA.Standard.IF.Data.v2.Common.Common.ResponseCode.Success,
                        Message = WA.Standard.IF.Data.v2.Common.Common.ResponseMessage.Success
                    };

                    WA.Standard.IF.Logger.Log.Log.SaveXMLLog(0, request.TransactionHeader.DealerID, "WA MessageReceiveResponse XML", response);
                }
            }
            catch (Exception ex)
            {
                response.Errors = GetErrorDataListFromException(ex);
                WA.Standard.IF.Logger.Log.Log.SaveErrorLog(null, "MessageReceive", request, ex.Message, ex);
            }

            return response;
        }