public UtilidadesClient(string endpointUrl) { SchemaValidation = new SchemaValidationSettings { Enabled = true, RaiseExceptions = true }; if (string.IsNullOrWhiteSpace(endpointUrl)) { throw new ArgumentException("You must specify the endpoint URL", "endpointUrl"); } if (endpointUrl.Contains("{")) { var regex = new Regex(@"\{([^\}]+)\}"); var matches = regex.Matches(endpointUrl); var parameters = new List <string>(); foreach (Match match in matches) { parameters.Add(match.Groups[1].Value); } throw new InvalidOperationException("Please replace parameter/s " + string.Join(", ", parameters) + " in the URL before passing it to the constructor "); } if (!endpointUrl.EndsWith("/")) { endpointUrl += "/"; } client = new HttpClient { BaseAddress = new Uri(endpointUrl) }; }
public IntermediateRoutingClient(HttpClient httpClient) { if(httpClient.BaseAddress == null) throw new InvalidOperationException("You must set the BaseAddress property of the HttpClient instance"); client = httpClient; SchemaValidation = new SchemaValidationSettings { Enabled = true, RaiseExceptions = true }; }
public ServiciosMuleClient(HttpClient httpClient) { if (httpClient.BaseAddress == null) { throw new InvalidOperationException("You must set the BaseAddress property of the HttpClient instance"); } client = httpClient; SchemaValidation = new SchemaValidationSettings { Enabled = true, RaiseExceptions = true }; }
/// <summary> /// Initializes a new instance of the <see cref="ContractEventValidationService"/> class. /// </summary> /// <param name="configReader">Azure config loader.</param> /// <param name="options">Configuration options for the validation service.</param> /// <param name="logger">Logger Adapater to allow logging within the service.</param> public ContractEventValidationService( IFeedProcessorConfiguration configReader, IOptions <SchemaValidationSettings> options, ILoggerAdapter <ContractEventValidationService> logger) { _options = options.Value; _configReader = configReader; _logger = logger; if (_options.SchemaVersion == "11_03") { _logger.LogInformation($"[{nameof(ContractEventValidationService)}] Loading schema version 11.03."); _xmlSchema = ReadSchemaFile(_options.SchemaManifestFilename); } else { _logger.LogWarning($"[{nameof(ContractEventValidationService)}] - Active schema version is missing - Schema not loaded"); } }