public void GetDictionary(string project, string app, string format) { try { format = MapContentType(project, app, format); if (IsAsync()) { string statusUrl = _adapterProvider.AsyncGetDictionary(project, app); WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.Accepted; WebOperationContext.Current.OutgoingResponse.Headers["location"] = statusUrl; } else { DataDictionary dictionary = _adapterProvider.GetDictionary(project, app); _adapterProvider.FormatOutgoingMessage <DataDictionary>(dictionary, format, true); } } catch (Exception ex) { WebOperationContext.Current.OutgoingResponse.StatusCode = HttpStatusCode.InternalServerError; HttpContext.Current.Response.ContentType = "text/plain"; HttpContext.Current.Response.Write(ex.Message); } }
public void GetDictionary() { DataDictionary dictionary = _adapterProvider.GetDictionary( _settings["ProjectName"], _settings["ApplicationName"]); Assert.AreNotEqual(0, dictionary.dataObjects.Count); }
public DataDictionary GetDictionary(string scope, string app) { try { OutgoingWebResponseContext context = WebOperationContext.Current.OutgoingResponse; context.ContentType = "application/xml"; DataDictionary dictionary = _adapterProvider.GetDictionary(scope, app); return(dictionary); } catch (Exception ex) { CustomErrorLog objCustomErrorLog = new CustomErrorLog(); _CustomError = objCustomErrorLog.customErrorLogger(ErrorMessages.errGetDictionary, ex, _logger); objCustomErrorLog.throwJsonResponse(_CustomError); return(null); } }