Create Service

URL:
https://<root>/services/createService
Methods:
POST
Required Capability:
Access allowed with any authorized privilege
Version Introduced:
10.1

Description

The createService operation creates a new GIS service in a folder. A service is created by submitting a JSON representation of the service to this operation.

The JSON representation of a service contains a number of properties that are divided into five sections:

Request parameters

ParameterDetails

service

The JSON representation of the service being created, which includes service description, service framework, service type, extension, and framework properties.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
service={
  "serviceName": "Test",
  "type": "MapServer",
  "description": "my map service",
  "capabilities": "map,query,data",
  "clusterName": "default",
  "minInstancesPerNode": 1,
  "maxInstancesPerNode": 2,
  "maxWaitTime": 60,
  "maxStartupTime": 300,
  "maxIdleTime": 1800,
  "maxUsageTime": 600,
  "recycleInterval": 24,
  "loadBalancing": "ROUND_ROBIN",
  "isolationLevel": "HIGH",
  "properties": {
    "maxBufferCount": "100",
    "virtualCacheDir": "https://SERVER:6080/arcgis/server/arcgiscache",
    "maxImageHeight": "2048",
    "maxRecordCount": "1000",
    "filePath": "\\\\machine\\data\\Corine\\CORINE6.msd",
    "maxImageWidth": "2048",
    "cacheOnDemand": "false",
    "virtualOutputDir": "https://SERVER:6080/arcgis/server/arcgisoutput",
    "outputDir": "C:\\arcgisserver\\arcgisoutput",
    "supportedImageReturnTypes": "MIME+URL",
    "isCached": "false",
    "ignoreCache": "false",
    "clientCachingAllowed": "false",
    "cacheDir": "C:\\arcgisserver\\arcgiscache\\Corine"
  },
  "extensions": [
    {
      "typeName": "KmlServer",
      "enabled": true,
      "capabilities": "SingleImage,SeparateImages,Vectors",
      "properties": {
        "minRefreshPeriod": "30",
        "compatibilityMode": "GoogleEarth",
        "imageSize": "1024",
        "dpi": "96",
        "endPointURL": "",
        "featureLimit": "1000000",
        "useDefaultSnippets": "false"
      }
    },
    {
      "typeName": "WFSServer",
      "enabled": true,
      "capabilities": "",
      "properties": {
        "appSchemaURI": "https://grid5:6080/arcgis",
        "appSchemaPrefix": "arcgis",
        "enableTransactions": "false"
      }
    },
    {
      "typeName": "WCSServer",
      "enabled": false,
      "capabilities": "",
      "properties": {}
    }
  ],
  "frameworkProperties": {
    "javaHeapSize": "64"
  }
}

f

The response format. The default response format is html.

Values: html | json | pjson

Service description properties

The following table outlines the common properties shared by all service types that are used to identify a specific service.

PropertyDescription

serviceName

The name of the service.

Example
Use dark colors for code blocksCopy
1
"serviceName": "Test"

type

The type of service.

Example
Use dark colors for code blocksCopy
1
"type": "MapServer"

description

An optional user-readable description for the service.

Example
Use dark colors for code blocksCopy
1
"description": "A sample description for a service"

capabilities

The capabilities of the service. The domains of these values are specific to each service type.

Example
Use dark colors for code blocksCopy
1
"capabilities": "Map,Query,Data"

Service framework properties

The following table outlines the properties targeted toward the framework that hosts the GIS service, which define the life cycle and load balancing of the service.

PropertyDescription

clusterName

The name of the cluster to which this service will be deployed.

Example
Use dark colors for code blocksCopy
1
"clusterName": "default"

minInstancesPerNode

The minimum number of instances of the service to create on each node in the cluster. The default is 1.

Example
Use dark colors for code blocksCopy
1
"minInstancesPerNode": 1

maxInstancesPerNode

The maximum number of instances of the service to create on each node in the cluster. The default is 2.

Example
Use dark colors for code blocksCopy
1
"maxInstancesPerNode": 2

maxWaitTime

The maximum amount of time (in seconds) the framework will wait to get a free instance of the service. The default is 60 seconds.

Example
Use dark colors for code blocksCopy
1
"maxWaitTime": 60

maxStartupTime

The maximum amount of time (in seconds) that can elapse on a startup attempt. When service instances are created in the GIS server, either as a result of the server starting or in response to a request of the server by a client, the time it takes to initialize the service instance is referred to as its creation time. When the maximum startup time has passed, it is assumed the startup has stopped responding and the GIS server cancels the creation of the service instance. The default is 300 seconds.

Example
Use dark colors for code blocksCopy
1
"maxStartupTime": 300

maxIdleTime

The maximum amount of time (in seconds) an idle instance of a service will remain idle before it is stopped. The default is 1800 seconds.

Example
Use dark colors for code blocksCopy
1
"maxIdleTime": 1800

maxUsageTime

The maximum amount of time (in seconds) an instance can service a request. The default is 600 seconds.

Example
Use dark colors for code blocksCopy
1
"maxUsageTime": 600

recycleInterval

The maximum amount of time (in hours) an instance of the service can run. The default is 24 hours.

Example
Use dark colors for code blocksCopy
1
"recycleInterval": 24

loadBalancing

Specifies the load balancing algorithm the framework will use for instances of a service among all the nodes in a cluster. The default is ROUND_ROBIN.

Values: ROUND_ROBIN | FAIL_OVER

isolationLevel

Specifies the isolation level under which an instance of a service will run. The default is HIGH.

Values: LOW | HIGH

Service type properties

The following table outlines the property that targets the core service type as seen by the server administrator. Since this property is associated with a server object, it varies across the service types.

PropertyDescription

properties

A JSON object containing the properties for the targeted service type.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
"properties": {
  "maxBufferCount": "100",
  "virtualCacheDir": "https://SERVER:6080/arcgis/server/arcgiscache",
  "maxImageHeight": "2048",
  "maxRecordCount": "1000",
  "filePath": "\\\\machine\\data\\Corine\\CORINE6.msd",
  "maxImageWidth": "2048",
  "cacheOnDemand": "false",
  "virtualOutputDir": "https://SERVER:6080/arcgis/server/arcgisoutput",
  "outputDir": "C:\\arcgisserver\\arcgisoutput",
  "supportedImageReturnTypes": "MIME+URL",
  "isCached": "false",
  "ignoreCache": "false",
  "clientCachingAllowed": "false",
  "cacheDir": "C:\\arcgisserver\\arcgiscache\\Corine"
}

Different properties are required for map, image, geoprocessing, and geocoding services.

PropertyDescription

filePath

(Required)

The full path, including the file name, of the map document file.

Example
Use dark colors for code blocksCopy
1
"filePath": "\\\\machine\\data\\Corine\\CORINE6.msd",

resampling

(Optional)

Specifies whether rendering will be used in Tile Package Clients such as ArcGIS Pro, Map Viewer, and JSAPI. When true, resampling will redraw images up to the maxScale value. In areas with no data, blurred images will be displayed.

Values: true | false

maxRecordCount

(Optional)

The maximum number of records that will be returned by query or data operations. The default value is 500.

Example
Use dark colors for code blocksCopy
1
"maxRecordCount": "500",

dateFieldsTimezoneID

(Optional)

The time zone that will be used by the service using the Windows ID for the time zone (for example, Pacific Standard Time or Eastern Standard Time).

Once set, it is assumed that all date field values will be stored in the specified time zone and data will be converted from UTC to the time zone specified before changes are written to the database. This property, if configured, only applies to date fields that are not used to time enable a layer and are not used in editor tracking date fields. When enabling this property, it must be placed immediately after maxRecordCount; otherwise, dateFieldsTimezoneID will be ignored.

Example

Example
Use dark colors for code blocksCopy
1
"dateFieldsRespectsDaylightSavingTime": "Pacific Standard Time",

dateFieldsRespectsDaylightSavingTime

(Optional)

If dateFieldsTimezoneID is defined, this Boolean property specifies whether time will be adjusted for daylight saving time. If daylight saving time does not apply to the data's region, set the value to false. If date values will be stored using daylight saving time when it is in effect, set this value to true.

Once set, it is assumed that all date field values will be stored in the specified time zone and data will be converted from UTC to the time zone specified before changes are written to the database. This property, if configured, only applies to date fields that are not used to time enable a layer and are not used in editor tracking date fields. When enabling this property, it must be placed immediately after maxRecordCount; otherwise, dateFieldsRespectsDaylightSavingTime will be ignored.

Values: true | false

maxBufferCount

(Optional)

The maximum number of selected features that can be buffered for map operations. The default value is 100.

Example
Use dark colors for code blocksCopy
1
"maxBufferCount": "100",

maxSampleSize

(Optional)

The maximum number of records that will be sampled when computing a class breaks renderer, which is used by the Generate Renderer operation.

Example
Use dark colors for code blocksCopy
1
"maxSampleSize": "100000",

maxImageWidth

(Optional)

The maximum image width allowed for requests. The default is 2048.

Example
Use dark colors for code blocksCopy
1
"maxImageWidth": "2048",

maxImageHeight

(Optional)

The maximum image height allowed for requests. The default is 2048.

Example
Use dark colors for code blocksCopy
1
"maxImageHeight": "2048",

supportedImageReturnTypes

(Optional)

The supported image return types. The default types are MIME+URL

Example
Use dark colors for code blocksCopy
1
"supportedImageReturnTypes": "MIME+URL",

isCached

(Optional)

A Boolean flag that specifies whether the map service will be cached (true) or dynamic (false).

Values: true | false

ignoreCache

(Optional)

A Boolean flag that specifies whether the map service will ignore the cache (true).

Values: true | false

cacheOnDemand

(Optional)

A Boolean flag that specifies whether cache tiles will be created on demand and added to the server cache directory as users navigate the map (true).

Values: true | false

disableCaching

(Optional)

A Boolean flag that specifies whether the REST handler will be disabled from caching all static resources, such as map service resource, layer resource, legends, and so on (true).

Values: true | false

clientCachingAllowed

(Optional)

A Boolean flag that specifies whether clients will be allowed to cache tiles (true).

Values: true | false

cacheDir

(Optional)

The physical directory where the tiles will be stored.

Example
Use dark colors for code blocksCopy
1
"cacheDir": "C:\\arcgisserver\\arcgiscache\\Corine"

virtualCacheDir

(Optional)

The virtual directory where the tiles can be accessed.

Example
Use dark colors for code blocksCopy
1
"virtualCacheDir": "https://SERVER:6080/arcgis/server/arcgiscache",

outputDir

(Required)

The physical directory where the temporary output files will be created.

Example
Use dark colors for code blocksCopy
1
"outputDir": "C:\\arcgisserver\\arcgisoutput",

virtualOutputDir

(Required)

The virtual directory where the output files can be accessed.

Example
Use dark colors for code blocksCopy
1
"virtualOutputDir": "https://SERVER:6080/arcgis/server/arcgisoutput",

connectionCheckInterval

(Optional)

The number of seconds between validity checks or repairs on SDE data connections used in a map service.

Example
Use dark colors for code blocksCopy
1
"connectionCheckInterval": "300",

schemaLockingEnabled

(Optional)

A Boolean tag that specifies whether the map service will acquire schema locks for map layers from a geodatabase (true). If locks will impede your workflow, set this value to false to disable schema locking.

Values: true | false

maxDomainCodeCount

(Optional)

The maximum number of domain codes that can be returned from all fields, subtypes, layers, and tables in a map service. The default value is 25000.

Example
Use dark colors for code blocksCopy
1
"maxDomainCodeCount": "25000",

useLocalCacheDir

(Optional)

A Boolean that specifies whether the ArcGIS Server map caching mechanism will write bundle files to a local directory and copy them to a shared cache directory (true) or write the files directly to the shared cache directory (false). This option can improve performance, but it only applies to the compact cache storage format when multiple machines are working on the cache.

Values: true | false

antialiasingMode

(Optional)

Specifies the antialiasing mode that will be used for drawing vectors in the map. The default is NONE.

Values: FASTEST | FAST | NORMAL | BEST | NONE

textAntialiasingMode

(Optional)

Specifies the antialiasing mode that will be used for drawing vectors in the map. The default is FORCE.

Values: NORMAL | FORCE | NONE

disableIdentifyRelates

(Optional)

A Boolean flag that specifies whether the processing of related records as a part of the identify results will be disabled. If there are too many related records, this may improve the performance of the identify operation. The default is false.

Values: true | false

enableDynamicLayers

(Optional)

A Boolean flag that specifies whether the map service will allow dynamic layer functionality such as reordering layers, changing symbology per request, and so on (true). The default value is false.

Values: true | false

dynamicDataWorkspaces

(Optional)

The workspace connections that will be available for the web clients applications for adding dynamic layers per request. This is a string value representing the JSON array containing JSON objects describing the workspace connection.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
"dynamicDataWorkspaces": [
  {
    "id": "<id>",
    "WorkspaceFactory": "SDE",
    "workspaceConnection": "<sde_connection_string>"
  },
  {
    "id": "<id>",
    "WorkspaceFactory":"FileGDB",
    "workspaceConnection": "DATABASE=<path_to_fgdb>"
  }
],

hasStaticData

Specifies whether the performance of a map service that uses static, unchanging data will be optimized (true). This property is automatically set to true when a map service is published by copying data to the server.

Values: true | false

cacheControlMaxAge

The value that will be returned for max-age as the cache-control response header by the Export operation and the Tile resource. If no value is provided, the default value of 0 seconds for the export request, 86400 seconds for tiles that the client can cache, and 0 seconds for tiles that disallow client caching, will be returned as the max-age value.

However, if client caching is not allowed, the max-age value for tile responses will always be 0, and any value provided for cacheControlMaxAge will be ignored.

Example
Use dark colors for code blocksCopy
1
"cacheControlMaxAge": "43200",

disableDownsamplingTilesForExportMap

Specifies whether the cached map service will render the image using the cache tiles. When set to false, if no cache tiles exist at a certain level, the image will use resampled cache data to render an image using CPU resources. When set to true, if no cache tiles exist for an Export request, the service will return an error. This property is used to optimize export requests. The default is false.

Values: true | false

failOnStartWhenDataInaccessible

Added at 10.8.1. Specifies whether starting a map service when a data source is inaccessible will fail. By default, when the data source of a layer or stand-alone table is inaccessible, a map service will start without listing broken layers or tables in its resources. However, when this property is set to true and the map service cannot access any of its layer or table sources, it will fail to start. The default is false.

Values: true | false

Extension properties

The table below outlines the properties that represent the extensions that are enabled on a service.

PropertyDescription

typeName

The type of extension. See the list of supported extension types.

Example
Use dark colors for code blocksCopy
1
"typeName": "KmlServer

capabilities

The capabilities of the extension type.

Example
Use dark colors for code blocksCopy
1
"capabilities": "SingleImage,SeparateImages,Vectors"

enabled

A Boolean that specifies whether the extension will be enabled on the service.

Values: true | false

properties

A bag of properties for the targeted extension type.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
"properties": {
  "minRefreshPeriod": "30",
  "compatibilityMode": "GoogleEarth",
  "imageSize": "1024",
  "dpi": "96",
  "endPointURL": "",
  "featureLimit": "1000000",
  "useDefaultSnippets": "false"
}

Framework properties

The table below defines the property used to determine the heap size that will be applied to a service.

PropertyDescription

javaHeapSize

The heap size for a particular service, which will override the default heap size properties you can set for all services using the Edit operation.

Providing a value for javaHeapSize will only affect this service; all other services in the machine will remain unchanged.

Example
Use dark colors for code blocksCopy
1
"javaHeapSize": "64"

Example usage

The following is a sample POST request for the createService operation:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
POST /webadaptor/admin/services/createService HTTP/1.1
Host: machine.domain.com
Content-Type: application/x-www-form-urlencoded
Content-Length: []

service={
  "serviceName": "Test",
  "type": "MapServer",
  "description": "my map service",
  "capabilities": "map,query,data",
  "clusterName": "default",
  "minInstancesPerNode": 1,
  "maxInstancesPerNode": 2,
  "maxWaitTime": 60,
  "maxStartupTime": 300,
  "maxIdleTime": 1800,
  "maxUsageTime": 600,
  "recycleInterval": 24,
  "loadBalancing": "ROUND_ROBIN",
  "isolationLevel": "HIGH",
  "properties": {
    "maxBufferCount": "100",
    "virtualCacheDir": "https://SERVER:6080/arcgis/server/arcgiscache",
    "maxImageHeight": "2048",
    "maxRecordCount": "1000",
    "filePath": "\\\\machine\\data\\Corine\\CORINE6.msd",
    "maxImageWidth": "2048",
    "cacheOnDemand": "false",
    "virtualOutputDir": "https://SERVER:6080/arcgis/server/arcgisoutput",
    "outputDir": "C:\\arcgisserver\\arcgisoutput",
    "supportedImageReturnTypes": "MIME+URL",
    "isCached": "false",
    "ignoreCache": "false",
    "clientCachingAllowed": "false",
    "cacheDir": "C:\\arcgisserver\\arcgiscache\\Corine"
  },
  "extensions": [
    {
      "typeName": "KmlServer",
      "enabled": true,
      "capabilities": "SingleImage,SeparateImages,Vectors",
      "properties": {
        "minRefreshPeriod": "30",
        "compatibilityMode": "GoogleEarth",
        "imageSize": "1024",
        "dpi": "96",
        "endPointURL": "",
        "featureLimit": "1000000",
        "useDefaultSnippets": "false"
      }
    },
    {
      "typeName": "WFSServer",
      "enabled": true,
      "capabilities": "",
      "properties": {
        "appSchemaURI": "https://grid5:6080/arcgis",
        "appSchemaPrefix": "arcgis",
        "enableTransactions": "false"
      }
    },
    {
      "typeName": "WCSServer",
      "enabled": false,
      "capabilities": "",
      "properties": {}
    }
  ],
  "frameworkProperties": {
    "javaHeapSize": "64"
  }
}&f=json

JSON Response examples

The following is a sample success response for the createService operation, indicating that the service was created successfully:

Use dark colors for code blocksCopy
1
2
3
{
  "status": "success"
}

The following error response is returned when an attempt is made to create a service with ArcMap as its service provider:

Use dark colors for code blocksCopy
1
2
3
4
5
{
  "status": "error",
  "messages": ["Failed to create the service 'SampleWorldCities10x.MapServer'. This service cannot be created because the ArcObjects provider is no longer supported. Starting at version 11.0, you must use the ArcObjects11 provider."],
  "code": 500
}

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.