public async Task <TableResultSet> ExecuteGetResultsLocation(String jobId) { TableResultSet retval = new TableResultSet(); conf.SetServiceEndpoint(mappingPrefix + resultsLocationEndpoint); this.parameterJson.Add("jobID", JsonValue.CreateStringValue(jobId)); try { JsonObject kObj = (JsonObject)(await this.Execute()); JsonObject tblWrapper = (JsonObject)kObj.GetNamedObject("table"); Table tbl = Table.FromJson(tblWrapper.GetNamedObject("@table")); retval.AddResults(tbl); retval.ReadJson(kObj); retval.ThrowExceptionIfUnsuccessful(); } finally { conf.SetServiceEndpoint(null); this.parameterJson.Remove("jobID"); } return(retval); }
/* get the last run result as a table result set */ protected TableResultSet GetRunResultAsTableResultSet() { TableResultSet retval = new TableResultSet(); if (this.runResult == null) { throw new Exception("last service communication resulted in null and cannot be converted"); } retval = new TableResultSet((JsonObject)this.runResult); return(retval); }
// results -------------------------------------------------------------------------------------------- public async Task <Table> ExecuteGetResultsTable(String jobId) { TableResultSet retval = null; conf.SetServiceEndpoint(mappingPrefix + getResultsTable); this.parameterJson.Add("jobID", JsonValue.CreateStringValue(jobId)); try { retval = await this.ExecuteWithTableResultReturn(); } finally { conf.SetServiceEndpoint(null); this.parameterJson.Remove("jobID"); } if (!retval.GetSuccess()) { throw new Exception(String.Format("Job failed. JobId='%s' Message='%s'", jobId, retval.GetRationaleAsString("\n"))); } return(retval.GetTable()); }
public async Task <Table> ExecuteGetResultsLocationWithSimpleReturn(String jobId) { TableResultSet retval = await this.ExecuteGetResultsLocation(jobId); return(retval.GetTable()); }