EDITranslatorQA.EDITranslator proxyQA = null; EDITranslatorQA.EDIOptionsDTO optionsQA = null; EDITranslatorPROD.EDITranslator proxyPROD = null; EDITranslatorPROD.EDIOptionsDTO optionsPROD = null; // Below checking ENV variable in the Cache class (defined in app.config): if (Cache.CacheInstance.ENV == "QA") { proxyQA = new EDITranslatorQA.EDITranslator(); optionsQA = new EDITranslatorQA.EDIOptionsDTO(); optionsQA.doTranslate = true; optionsQA.getAudit = true; } else if (Cache.CacheInstance.ENV == "PROD") { proxyPROD = new EDITranslatorPROD.EDITranslator(); optionsPROD = new EDITranslatorPROD.EDIOptionsDTO(); optionsPROD.doTranslate = true; } var failCount = 0; var succeeded = false; while ((failCount < 2) && (!succeeded)) { try { if (Cache.CacheInstance.ENV == "PROD") { EDITranslatorPROD.EDIResponseDTO output = proxyPROD.TransVal(System.Convert.ToString(input), optionsPROD); succeeded = true; return (System.Convert.ToString(output.native.ToString())); } else if (Cache.CacheInstance.ENV == "QA") { EDITranslatorQA.EDIResponseDTO output = proxyQA.TransVal(System.Convert.ToString(input), optionsQA); succeeded = true; return (System.Convert.ToString(output.native.ToString())); } } catch (WebException wex) {.....etc. }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)