The typical output of a geoprocessing REST service is a JSON representation. The clients interpret the JSON and define symbology accordingly. However, if the service has been published with a result map service option, the geoprocessing server creates an accompanying map service with visual representation of outputs. The result map service can be added to web maps and web applications.
How is a geoprocessing service published with a result map service option?
The View results with a Map Service option is enabled when publishing a geoprocessing service. You can also enable this option for a published service by editing the geoprocessing service property through ArcGIS Server Manager or ArcMap.
What are the layers in a result map service?
A result map service creates a layer for each output parameter. The layer ordering will correspond to the order of the output parameters as defined in geoprocessing task description.
Does a result map service contain layers for all output parameters?
A result map service will contain a layer for all geodataset output parameters such as GPFeatureRecordsetLayer, GPRasterDataLayer and GPRecordSet. Scalar outputs such as GPDate, GPDouble, GPLong, GPBoolean, GPDataFile, and GPLinearUnit cannot be represented as a map and no layer will be returned for these parameters.
Output parameters of data type GPString are a special case. Geoprocessing outputs of GPString can be scalar or can be a reference to a geodataset such as TIN, CAD layer, or geostatistical layer. If the output is a reference to geodataset, the result map service will contain a layer.
Where does the symbology of the map service layers come from?
The symbology of the layers is based on the symbology defined by the author of the service.
How are result map services and layers accessed?
A result map service is created for every successful asynchronous job. An asynchronous geoprocessing job is identified by a unique jobId. A result map service is accessed using the jobIdas shown below:
http://<arcgis rest services>/<GPServiceName>/MapServer/jobs/<jobID>
The layers in a result map service are accessed similar to map service layers based on the order of the layers.
http://<arcgis rest services>/<GPServiceName>/MapServer/jobs/<jobID>/0http://<arcgis rest services>/<GPServiceName>/MapServer/jobs/<jobID>/1
What are the supported operations and functionalities?
The result map service is a dynamic map service and supports all operations and child resources of a typical dynamic map service.:
Map service operations
A result map service is also time-aware and supports querying and exporting maps based on time.
How is a result map service added in web applications?
You can use the jobId to add a result map service as a dynamic map service layer in web apps. Also, you can access any of the feature layers in a result map service independently and add them as feature layers in web map.
What is the life span of result map services?
The lifespan of a result map service is determined by the Maximum file age property of arcgisjobs directory. The default value is 360 minutes but can be modified by an ArcGIS Server administrator through ArcGIS Server Manager or ArcMap. The illustration below shows the Edit Directory dialog box in ArcGIS Server Manager and the settings of the arcgisjobs directory, including Maximum file age.
The maximum file age property applies to all the asynchronous jobs and associated result map services in the arcgisjobs directory. Modifying it will affect all jobs and result map services created in the arcgisjobs directory.