ValidationResult CanConnectServer(IWebSource source) { try { return(new ValidationResult { Result = Execute(source, WebRequestMethod.Get, source.DefaultQuery, null, true, out var errors) }); }
public WebServiceSourceDefinition(IWebSource db) { AuthenticationType = db.AuthenticationType; DefaultQuery = db.DefaultQuery; Id = db.ResourceID; Name = db.ResourceName; Password = db.Password; HostName = db.Address; Path = db.GetSavePath(); UserName = db.UserName; }
public ValidationResult Test(IWebSource source) { try { return(CanConnectServer(source)); } catch (Exception ex) { RaiseError(ex); return(new ValidationResult { IsValid = false, ErrorMessage = ex.Message }); } }
public void CreateHost(ApplicationServer server, IWebSource webSource) { string v = vpath; if (v != "/" && v.EndsWith("/")) { v = v.Substring(0, v.Length - 1); } AppHost = ApplicationHost.CreateApplicationHost(webSource.GetApplicationHostType(), v, realPath) as IApplicationHost; AppHost.Server = server; // Link the host in the application domain with a request broker in the main domain RequestBroker = webSource.CreateRequestBroker(); AppHost.RequestBroker = RequestBroker; }
protected virtual string PerformWebPostRequest(IEnumerable <INameValue> head, string query, IWebSource source, string postData) { return(WebSources.Execute(source, WebRequestMethod.Post, query, postData, true, out _errorsTo, head.Select(h => h.Name + ":" + h.Value).ToArray())); }
public ApplicationServer (IWebSource source) { webSource = source; }
public void CreateHost (ApplicationServer server, IWebSource webSource) { string v = vpath; if (v != "/" && v.EndsWith ("/")) { v = v.Substring (0, v.Length - 1); } AppHost = ApplicationHost.CreateApplicationHost (webSource.GetApplicationHostType(), v, realPath) as IApplicationHost; AppHost.Server = server; // Link the host in the application domain with a request broker in the main domain RequestBroker = webSource.CreateRequestBroker (); AppHost.RequestBroker = RequestBroker; }
public ApplicationServer(IWebSource source) { webSource = source; }
protected virtual string PerformFormDataWebPostRequest(IWebSource source, WebRequestMethod method, string query, IEnumerable <INameValue> head, IEnumerable <IFormDataParameters> parameters) { return(WebSources.Execute(source, method, head.Select(h => h.Name + ":" + h.Value).ToArray(), query, isNoneChecked: false, isFormDataChecked: true, data: string.Empty, throwError: true, out _errorsTo, parameters)); }
protected override string PerformWebPostRequest(IEnumerable <INameValue> head, string query, IWebSource source, string postData) { Head = head; QueryRes = query; PostValue = postData; if (!string.IsNullOrWhiteSpace(HasErrorMessage)) { base._errorsTo = new ErrorResultTO(); base._errorsTo.AddError(ResponseFromWeb); } return(ResponseFromWeb); }