public override void FixtureSetup() { base.FixtureSetup(); context.BaseUrl = "http://*****:*****@www.brockmann-consult.de/bc-wps/wps/calvalus"; providerSecret.Proxy = true; processIdentifier = "com.terradue.wps_oozie.process.OozieAbstractAlgorithm"; processVersion = "1.0.0"; processSecretIdentifier = "urbantep-local~1.0~Subset"; processSecretVersion = "1.0"; provider.Store(); provider.StoreProcessOfferings(); providerSecret.Store(); providerSecret.StoreProcessOfferings(); }
private WpsProvider CreateProvider(string identifier, string name, string url, bool proxy) { WpsProvider provider; provider = new WpsProvider(context); provider.Identifier = identifier; provider.Name = name; provider.Description = name; provider.BaseUrl = url; provider.Proxy = proxy; try{ provider.Store(); }catch (Exception e) { throw e; } return(provider); }
public void LoadWpsJobStatus() { WpsProvider provider = CreateProvider("planetek", "planetek", "http://urban-tep.planetek.it/wps/WebProcessingService", true); provider.Store(); WpsProcessOffering process = CreateProcess(provider, "it.planetek.wps.extension.Processor", "Title of the processor"); process.Store(); WpsJob job = new WpsJob(context); job.WpsId = process.Identifier; job.StatusLocation = "http://urban-tep.planetek.it/wps/RetrieveResultServlet?id=72ed982a-8522-4c02-bb71-77f4c22a7808"; var jobresponse = job.GetStatusLocationContent(); var execResponse = jobresponse as ExecuteResponse; job.UpdateStatusFromExecuteResponse(execResponse); //get job recast response execResponse = ProductionResultHelper.GetWpsjobRecastResponse(context, job, execResponse); Assert.True(true); }
/// <summary> /// Get list of Processing Services from Atom Feed /// Each Item of the feed contains a Describe Process url /// </summary> /// <param name="context"></param> /// <param name="feed"></param> /// <param name="createProviderIfNotFound"></param> /// <returns></returns> public static List <WpsProcessOffering> GetRemoteWpsProcessingOfferingsFromUrl(IfyContext context, string url, bool createProviderIfNotFound) { var remoteProcesses = new List <WpsProcessOffering>(); var items = GetRemoteWpsServiceEntriesFromUrl(context, url); foreach (OwsContextAtomEntry item in items) { var wps = GetWpsProcessOfferingFromProcessDescriptionAtomFeed(context, item); if (wps == null) { continue; } var describeProcessUrl = wps.Url; var providerBaseUrl = describeProcessUrl.Substring(0, describeProcessUrl.LastIndexOf("/")); var processIdentifier = describeProcessUrl.Substring(describeProcessUrl.LastIndexOf("/") + 1); WpsProvider wpsprovider = null; try { wpsprovider = WpsProvider.FromBaseUrl(context, providerBaseUrl); } catch (System.Exception) { if (createProviderIfNotFound) { var urip = new Uri(providerBaseUrl); wpsprovider = new WpsProvider(context); wpsprovider.Identifier = urip.AbsolutePath.Contains("/wps3/processes") ? urip.Host + urip.AbsolutePath.Substring(0, urip.AbsolutePath.IndexOf("/wps3/processes")).Replace("/", ".") : Guid.NewGuid().ToString(); wpsprovider.Name = urip.AbsolutePath.Contains("/wps3/processes") ? urip.Host + urip.AbsolutePath.Substring(0, urip.AbsolutePath.IndexOf("/wps3/processes")).Replace("/", ".") : urip.Host + urip.AbsolutePath.Replace("/", "."); wpsprovider.BaseUrl = providerBaseUrl; wpsprovider.StageResults = true; wpsprovider.Proxy = true; wpsprovider.Store(); wpsprovider.GrantPermissionsToAll(); } } if (wpsprovider != null) { wps.Provider = wpsprovider; } //case WPS 3.0 if (IsWPS3(describeProcessUrl)) { try { WpsProcessOffering process = GetProcessingFromDescribeProcessWps3(context, describeProcessUrl); wps.RemoteIdentifier = process.RemoteIdentifier; if (string.IsNullOrEmpty(wps.Name)) { wps.Name = process.Name; } if (string.IsNullOrEmpty(wps.Description)) { wps.Description = process.Description; } if (string.IsNullOrEmpty(wps.Version)) { wps.Version = process.Version; } }catch (System.Exception e) { context.LogError(context, "Error with url '" + describeProcessUrl + "' : " + e.Message); wps = null; } } if (wps == null) { continue; } remoteProcesses.Add(wps); } return(remoteProcesses); }