Exemplo n.º 1
0
        public WmsAuthService(string baseUrl, IHttpClientStore httpClientStore)
        {
            Contract.Requires(baseUrl != null);
            Contract.Requires(httpClientStore != null);

            _baseUrl         = baseUrl;
            _httpClientStore = httpClientStore;
        }
Exemplo n.º 2
0
        public ExtDirectProvider(string baseUrl, string path, IHttpClientStore httpClientStore)
        {
            Contract.Requires(!string.IsNullOrEmpty(baseUrl));
            Contract.Requires(httpClientStore != null);

            _rpcPath    = (baseUrl.Last() == '/' ? baseUrl : baseUrl + "/") + path;
            _httpClient = httpClientStore.GetOrCreate(baseUrl);

            _metadata = GetMetadata(_rpcPath);
        }
Exemplo n.º 3
0
        public static void Authenticate(string baseUrl, IHttpClientStore clientStore, string login = TestSettings.DefaultOkLogin, string pass = TestSettings.DefaultOkPass)
        {
            var    authSvc = new WmsAuthService(baseUrl, clientStore);
            string userCode;
            var    res = authSvc.Authenticate(login, pass, out userCode);

            if (!res)
            {
                throw new AuthenticationException();
            }
        }