Example #1
0
 ValidationResult CanConnectServer(IWebSource source)
 {
     try
     {
         return(new ValidationResult
         {
             Result = Execute(source, WebRequestMethod.Get, source.DefaultQuery, null, true, out var errors)
         });
     }
Example #2
0
 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;
 }
Example #3
0
 public ValidationResult Test(IWebSource source)
 {
     try
     {
         return(CanConnectServer(source));
     }
     catch (Exception ex)
     {
         RaiseError(ex);
         return(new ValidationResult {
             IsValid = false, ErrorMessage = ex.Message
         });
     }
 }
Example #4
0
        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;
        }
Example #5
0
 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;
		}
Example #8
0
 public ApplicationServer(IWebSource source)
 {
     webSource = source;
 }
Example #9
0
 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));
 }
Example #10
0
 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);
 }