示例#1
0
        public static QasProWeb.QASearch MapAddressToQasSearch(DataContracts.AddressModel addr)
        {
            _log.Debug("START MapAddressToQasSearch");
            EngineType engineType = new EngineType();

            engineType.Intensity = EngineIntensityType.Close;
            engineType.PromptSet = PromptSetType.Default;
            engineType.Threshold = Config.QasThreshold.ToString();
            engineType.Timeout   = Config.QasTimeout.ToString();
            engineType.Flatten   = true;
            engineType.Value     = EngineEnumType.Verification;

            // qas adds
            engineType.IntensitySpecified = true;
            engineType.PromptSetSpecified = true;
            engineType.FlattenSpecified   = true;
            // end qas adds


            QASearch search = new QASearch();

            search.Country = "USA";
            search.Layout  = Config.QasLayout.ToString();
            search.Engine  = engineType;
            search.Search  = GetFormatedAddressString(addr);

            _log.Debug("END MapAddressToQasSearch");

            return(search);
        }
示例#2
0
        public AddrValidationResponseModel ValidateAddress(AddressModel addr)
        {
            _log.Debug("START ValidateAddress");
            _log.Debug(addr.ToString());
            QASearch       search = TranslateAddrValidationModel.MapAddressToQasSearch(addr);
            QASearchResult result = _proxy.ValidateAddress(search);
            AddrValidationResponseModel response = TranslateAddrValidationModel.MapGetResponseToModel(result);

            _log.Debug("END ValidateAddress");
            return(response);
        }
示例#3
0
        public QASearchResult ValidateAddress(QASearch search)
        {
            _log.Info("InvokeQasService.ValidateAddress() starting ...");
            QAPortTypeClient client = null;
            QASearchResult   result = null;

            try
            {
                client = new QAPortTypeClient();
                _log.Info("InvokeQasService.ValidateAddress() client created ...");
                int retryCount = 0;
                result = client.DoSearch(search);
                if (result == null && retryCount == 0)
                {
                    // retry once
                    result = client.DoSearch(search);
                    retryCount++;
                }
                _log.Info("InvokeQasService.ValidateAddress() result was returned from service ...");
            }
            catch (TimeoutException timeout)
            {
                _log.Error("InvokeQasService.ValidateAddress() Timeout Exception:" + timeout.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (CommunicationException comm)
            {
                _log.Error("InvokeQasService.ValidateAddress() Communication Exception:" + comm.Message);
                ProxyHelper.HandleServiceException(client);
            }
            catch (Exception e)
            {
                _log.Error("InvokeQasService.ValidateAddress() Exception:" + e.Message);
            }
            finally
            {
                if (client != null && client.State != CommunicationState.Closed)
                {
                    ProxyHelper.CloseChannel(client);
                }
            }

            _log.Info("InvokeQasService.ValidateAddress() ending ...");
            return(result);
        }