Geoprocessing service SubmitJob method
Executes an asynchronous geoprocessing tool.
SubmitJob(string ToolName, GPValue[] Values, GPResultOptions Options, PropertySet EnvironmentValues)
Parameter |
Description |
---|---|
ToolName |
The name of a server tool in a geoprocessing service. |
Values |
An array of GPValue instances, one for each input to the tool. |
Options |
Defines how the result values are returned. Can be null. If specified, results are modified using these options during tool execution. |
EnvironmentValues |
Name value pairs which can be used to modify tool execution. Can be null. Environment values can be general or specific to the operations within the tool. |
Return Value
A string defining the job ID.
Remarks
The arguments for this method are the same as Execute. A job id is returned as soon as the job is submitted. A client can use GetJobStatus to check the status of the job and GetJobResult to get the job results.
Use GetToolInfo to determine the input values for the tool. Each tool parameter has a direction indicating input or output.
Result Options are used to indicate various options for returning result values. If the options is null, the default options are used. Result Options reference a number of properties, including "DensifyFeatures", "TransportType", "SpatialReference", Format, and "FormatProperties". See GPResultOptions for details.
Environment values can be general or specific to the operations (tools) within the server tool. General environment values apply to all operations. Specific environment values only affect specific operations. By default, the server tool does not provide information on the operations it contains, only the input and output types. The service publisher must provide information on the operations within the tool for consumers to know which environment values are valid. For more information, see A quick tour of geoprocessing environments in the ArcGIS Help.
Examples
C#
string endpoint = "http://sampleserver2.arcgisonline.com/ArcGIS/services/Portland/ESRI_CadastralData_Portland/GPServer";
GPServerProxy gpserver = new GPServerProxy(endpoint);
//Set up the input parameter container
GPValue[] gpValues = new GPValue[2];
//create the parcel id value
GPString parcelID = new GPString();
parcelID.Value = "1S124CB04400";
//create the search distance value (long)
GPLong searchDistance = new GPLong();
searchDistance.Value = 250;
//add the parameters to the parameter list
gpValues[0] = parcelID;
gpValues[1] = searchDistance;
//submit th job and retrieve the jobid
string jobID = gpserver.SubmitJob("MailingList", gpValues, null, null);
//to track job status see GetJobStatus
//to access job messages see GetJobMessages
//to retrieve job results see GetJobResult