private string GetTemplateList(string pTradingSysCode, ref bool fromCache, string dataDir) { string xmlResult = ""; try { GetConfirmationTemplatesResponse response = GetTemplates(pTradingSysCode); // confirmationTemplate resultList = new confirmationTemplate(); //resultList = response.confirmationTemplates xmlResult = WriteIntoXml(response.confirmationTemplates); PushXMlToCache(xmlResult, pTradingSysCode, dataDir);//save this data user level folder so that user can use that next instance when service is down. return(xmlResult); } catch (Exception ex) { //TODO: on specific exception where service not run stuff like that try { fromCache = true; return(GetTemplateListFromCache(pTradingSysCode, dataDir)); } catch (Exception exL) { throw new Exception("The Services are down. Please contact the administrator." + Environment.NewLine + "Error CNF-545 in " + FORM_NAME + ".GetTradeData(): " + ex.Message); } } }
private GetConfirmationTemplatesResponse GetTemplates(string pTradingSysCode) { string confirmMgrUrl = baseUrlStr + @"/" + CONFIRMATIONS_MGR_URL_EXT; ConfirmationsManagerClient client = new ConfirmationsManagerClient(CONFIRMATIONS_MGR_ENDPOINT, confirmMgrUrl); client.ClientCredentials.UserName.UserName = svcUserName; client.ClientCredentials.UserName.Password = svcPassword; GetConfirmationTemplatesRequest request = new GetConfirmationTemplatesRequest(); GetConfirmationTemplatesResponse response = new GetConfirmationTemplatesResponse(); request.tradingSystemCode = pTradingSysCode; response = client.getConfirmationTemplates(request); //throw new Exception(); //for test bad scenario return(response); }
private GetConfirmationTemplatesResponse GetTemplates(string pTradingSysCode) { string confirmMgrUrl = baseUrlStr + @"/" + CONFIRMATIONS_MGR_URL_EXT; ConfirmationsManagerClient client = new ConfirmationsManagerClient(CONFIRMATIONS_MGR_ENDPOINT, confirmMgrUrl); client.ClientCredentials.UserName.UserName = svcUserName; client.ClientCredentials.UserName.Password = svcPassword; GetConfirmationTemplatesRequest request = new GetConfirmationTemplatesRequest(); GetConfirmationTemplatesResponse response = new GetConfirmationTemplatesResponse(); request.tradingSystemCode = pTradingSysCode; response = client.getConfirmationTemplates(request); //throw new Exception(); //for test bad scenario return response; }