public TQueryServiceDemo() { try { queryServiceDemo = new QueryServiceDemo(DefaultRepository, SecondaryRepository, UserLoginName, Password); } catch (FaultException <SerializableException> ex) { Console.WriteLine(String.Format("Got FaultException[{0}] with message: {1}\n", ex.Detail, ex.Message)); } catch (Exception exx) { Console.WriteLine(exx.StackTrace); } }
public IEnumerable <KeywordModel> GetSearchKeywords() { string result = "load"; IEnumerable <KeywordModel> keywords = null; Usermaster resultObjUM = null; try { string username, password; (username, password) = SecurityHelper.GetCredentials(User.Identity as ClaimsIdentity); using (var client = new HttpClient()) { try { string uri = ConfigurationManager.AppSettings["GetEPFMSettings"] + "?Username="******"N" ? resultObjUM.EpfmUsername : username; password = resultObjUM.Isaduser == "N" ? resultObjUM.EpfmPassword : password; Logger.WriteLog(JsonConvert.SerializeObject(resultObjUM)); } else { new Exception("ERCMS Core API failed" + httpresult.ReasonPhrase); } } catch (Exception ex) { Logger.WriteLog("ERCMS Core API failed " + ex.Message + Environment.NewLine + ex.StackTrace); throw ex; } } String repository = ConfigurationManager.AppSettings["EPFMRepository"]; //String username = ConfigurationManager.AppSettings["EPFMUsername"]; //String password = ConfigurationManager.AppSettings["EPFMPassword"]; String address = ConfigurationManager.AppSettings["EPFMAddress"]; //SearchServiceDemo searchServiceDemo = new SearchServiceDemo(repository, null, userName, password, address); //keywords = searchServiceDemo.SimplePassthroughQueryForKeywords(); //result = "Setting Context"; QueryServiceDemo t = new QueryServiceDemo(repository, null, username, password, address); keywords = t.callQueryServiceKeyword(); } catch (Exception ex) { result = result + "Got exception" + ex.StackTrace; throw new Exception(result); } return(keywords); }