Click or drag to resize

LocalGeoprocessingService Class

A class representing a local geoprocessing service hosted by the runtime local server.
Inheritance Hierarchy
SystemObject
  Esri.ArcGISRuntime.LocalServicesLocalService
    Esri.ArcGISRuntime.LocalServicesLocalGeoprocessingService

Namespace:  Esri.ArcGISRuntime.LocalServices
Assembly:  Esri.ArcGISRuntime.LocalServices (in Esri.ArcGISRuntime.LocalServices.dll) Version: 100.6.0.0
Syntax
public sealed class LocalGeoprocessingService : LocalService

The LocalGeoprocessingService type exposes the following members.

Constructors
  NameDescription
Public methodLocalGeoprocessingService(String)
Initializes a new instance of the LocalGeoprocessingService class based on the provided path to a geoprocessing package.
Public methodLocalGeoprocessingService(String, GeoprocessingServiceType)
Initializes a new instance of the LocalGeoprocessingService class based on the provided path to a geoprocessing package and service type.
Top
Properties
  NameDescription
Public propertyError
Gets the associated error if the server's Status is FailedToLoad.
(Inherited from LocalService.)
Public propertyMaxRecords
Gets or sets the maximum number of records that can be returned by the Geoprocessing service.
Public propertyName
Gets the unique auto-assigned name for the service.
(Inherited from LocalService.)
Public propertyPackagePath
Gets the path of the package file on which the LocalService is based.
(Inherited from LocalService.)
Public propertyServiceType
Gets or sets the execution type of the local geoprocessing service.
Public propertyStatus
Gets the local server status.
(Inherited from LocalService.)
Public propertyUrl
Gets the Url of the local geoprocessing service.
(Overrides LocalServiceUrl.)
Top
Methods
  NameDescription
Public methodStartAsync
Asynchronously starts the local geoprocessing service.
(Overrides LocalServiceStartAsync.)
Public methodStopAsync
Asynchronously stops this local service instance, and returns a Task object.
(Inherited from LocalService.)
Top
Events
  NameDescription
Public eventStatusChanged
Occurs when Status of this local service has changed.
(Inherited from LocalService.)
Top
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.

See Also