Exemple #1
0
        /// <summary>
        /// Begin request for Inbound service.
        /// </summary>
        /// <param name="inboundRequest"></param>
        /// <param name="inboundServiceCallback"></param>
        public ToaRequestResult BeginSyncRequest(InboundRequest inboundRequest)
        {
            _log.Debug("InboundService - BeginRequest() - Start");
            var inboundRequestElement = inboundRequest.GetInboundRequestElement();

            _log.Debug(ToaLogMessages.InboundServiceRequest, Json.Encode(inboundRequestElement));

            //Validate the current sitename.
            if (!ToaCommonUtil.ValidateCurrentSiteName())
            {
                return(null);
            }

            var inboundResult = _inboundInterfaceService.inbound_interface(inboundRequestElement);

            _log.Debug(ToaLogMessages.InboundServiceResponse, Json.Encode(inboundResult));

            //TODO: Initialize response
            var toaResponse = new ToaRequestResult();

            _log.Notice("Started processing response element");
            toaResponse.processResponseElement(inboundResult);
            _log.Debug("InboundService - BeginRequest() - End");
            return(toaResponse);
        }
Exemple #2
0
        /// <summary>
        /// Begin request for Inbound service.
        /// </summary>
        /// <param name="inboundRequest"></param>
        /// <param name="inboundServiceCallback"></param>
        public void BeginRequest(InboundRequest inboundRequest, InboundServiceDelegate inboundServiceCallback)
        {
            _log.Debug("InboundService - BeginRequest() - Start");
            var backgroundService = new ToaBackgroundServiceUtil();

            backgroundService.RunAsync(() =>
            {
                _log.Debug("InboundService - BeginRequest() - Thread Started");
                var inboundRequestElement = inboundRequest.GetInboundRequestElement();
                var inboundResult         = _inboundInterfaceService.inbound_interface(inboundRequestElement);

                //TODO: Initialize response
                var toaResponse = new ToaRequestResult();
                inboundServiceCallback.Invoke(toaResponse);
                _log.Debug("InboundService - BeginRequest() - Thread Ended");
            });
            _log.Debug("InboundService - BeginRequest() - End");
        }
        /// <summary>
        /// Begin request for Inbound service.
        /// </summary>
        /// <param name="inboundRequest"></param>
        /// <param name="inboundServiceCallback"></param>
        public void BeginRequest(InboundRequest inboundRequest, InboundServiceDelegate inboundServiceCallback)
        {
            _log.Debug("InboundService - BeginRequest() - Start");
            var backgroundService = new ToaBackgroundServiceUtil();
            backgroundService.RunAsync(() =>
                {
                    _log.Debug("InboundService - BeginRequest() - Thread Started");
                    var inboundRequestElement = inboundRequest.GetInboundRequestElement();
                    var inboundResult = _inboundInterfaceService.inbound_interface(inboundRequestElement);

                    //TODO: Initialize response
                    var toaResponse = new ToaRequestResult();
                    inboundServiceCallback.Invoke(toaResponse);
                    _log.Debug("InboundService - BeginRequest() - Thread Ended");

                });
            _log.Debug("InboundService - BeginRequest() - End");
        }
        /// <summary>
        /// Begin request for Inbound service.
        /// </summary>
        /// <param name="inboundRequest"></param>
        /// <param name="inboundServiceCallback"></param>
        public ToaRequestResult BeginSyncRequest(InboundRequest inboundRequest)
        {
            _log.Debug("InboundService - BeginRequest() - Start");
            var inboundRequestElement = inboundRequest.GetInboundRequestElement();
            _log.Debug(ToaLogMessages.InboundServiceRequest,Json.Encode(inboundRequestElement));

            //Validate the current sitename.
            if (!ToaCommonUtil.ValidateCurrentSiteName())
            {
                return null;
            }

            var inboundResult = _inboundInterfaceService.inbound_interface(inboundRequestElement);
            _log.Debug(ToaLogMessages.InboundServiceResponse, Json.Encode(inboundResult));

            //TODO: Initialize response
            var toaResponse = new ToaRequestResult();
            _log.Notice("Started processing response element");
            toaResponse.processResponseElement(inboundResult);
            _log.Debug("InboundService - BeginRequest() - End");
            return toaResponse;
        }