Class LocalGeoprocessingService
A class representing a local geoprocessing service hosted by the runtime local server.
Namespace: Esri.ArcGISRuntime.LocalServices
Assembly: Esri.ArcGISRuntime.LocalServices.dll
Syntax
public sealed class LocalGeoprocessingService : LocalService
Remarks
A single local geoprocessing service instance corresponds directly to a geoprocessing package shared from ArcGIS for Desktop. One or more geoprocessing tasks may be exposed by the local geoprocessing service depending on the number of individual tool or script results contained within the geoprocessing package. When starting local geoprocessing services there are a number of properties you must choose values for which are usually determined by the server administrator for online geoprocessing services hosted by ArcGIS for Server.
These properties are:
- Service execution type: The ServiceType property determines whether the service will run the task asynchronously or synchronously. This affects how the client application you are developing interacts with the runtime local server and gets the result from the task. When a service is set to SynchronousExecute (synchronous) operation, the client waits for the task to finish. Typically, a service that will run tasks synchronously should execute quickly (five seconds or less). A service should be set to use the AsynchronousSubmit (asynchronous) if one or more of that tasks within that service will takes longer to run. When using the SubmitJob mode the client application must periodically ask the server if the task has finished and, if it has finished, get the result. The GeoprocessingServiceType enumeration values which determine the synchronous or asynchronous service operation are called "Execute" and "SubmitJob" to align them with the corresponding methods on the Geoprocessor task API and to differentiate them from the synchronous or asynchronous usage. You must use the method which corresponds to the GeoprocessingServiceType of the local geoprocessing service you are working with. The service mode AsynchronousSubmitWithMapServiceResult will enable you to display the results of the task within a local map service.
- Maximum number of records returned: The maximum number of results the service can return to a client. Setting this value to a large number means your runtime local server can handle sending a lot of individual records or features to the client application. Whether you choose this pattern depends on the number and complexity of the feature geometries. If you do not want to return any features, set this value to 0 (zero). Typically, you set this value to zero only when you create the service as AsynchronousSubmitWithMapServiceResult. To determine whether the MaxRecords limits has been exceeded you should check the exceeded transfer limit property of the feature set or record set returned by the task. The exceeded transfer limit property will be set to true when the number of records and features of the output parameter exceed the maximum number of records specified by the service. This information is also included in the Messages of GeoprocessingJob returned by the service.
Once you have created a new LocalGeoprocessingService and specified the PackagePath, ServiceType and MaxRecords properties, starting the service via the StartAsync() method will populate the Url property. It is this last property, the URL of the local geoprocessing service that you provide a GeoprocessingTask task with in order to interact with the tasks exposed by the service. Additionally you can use the static GetServiceAsyncTask method to instantiate and start a new local geoprocessing service.
Constructors
Name | Description |
---|---|
LocalGeoprocessingService(String) | Initializes a new instance of the LocalGeoprocessingService class based on the provided path to a geoprocessing package. |
LocalGeoprocessingService(String, GeoprocessingServiceType) | Initializes a new instance of the LocalGeoprocessingService class based on the provided path to a geoprocessing package and service type. |
Properties
Name | Description |
---|---|
MaxRecords | Gets or sets the maximum number of records that can be returned by the Geoprocessing service. |
ServiceType | Gets or sets the execution type of the local geoprocessing service. |
Url | Gets the Url of the local geoprocessing service. |
Methods
Name | Description |
---|---|
StartAsync() | Asynchronously starts the local geoprocessing service. |
StartAsync(CancellationToken) | Asynchronously starts the local geoprocessing service. |
Applies to
Target | Versions |
---|---|
.NET Windows | 100.13 - 200.6 |
.NET Framework | 100.0 - 200.6 |