ArcGIS Server REST API works out-of-the-box without requiring special configuration. However, if you needed to change the defaults, an understanding of the various configuration points is required.
Configuring the REST API |
The REST configuration consists of one file rest-config.properties
, which is found in the <ArcGIS Server installation location>/Server/framework/runtime/tomcat/webapps/arcgis#rest/WEB-INF/classes/resources
folder. This file indicates properties such as the URLs to the JavaScript API and ArcGIS.com map viewer that will be used by the Services Directory. In a multiple-machine site, edits to this file should be made on each GIS server that participates in the site.
If the client includes a “Origin” header in the request, the REST instance will determine if this origin has cross-domain access or not. If it has access, then it will include an “Access-Control-Allow-Origin” header in the response and the value will simply echo the value of the “Origin” header. If it does not have access, it will not include this response header.
By default, the REST API will allow access to all domains. To restrict access, users need to specify a new allowedOrigins
property in the rest config. The value should be a comma-delimited list of allowed domains.
From 10.1 SP1 onwards, ArcGIS Server token service supports Cross Origin Access and will always allow access to all domains.
Example:
allowedOrigins=http://foo, http://bar:9090
Services Directory gives you the ability to view Map and Image services using the ArcGIS JavaScript API. You can configure the URLs to various resources for this library using the properties in rest-config.properties
discussed here.
jsapi.arcgis
- URL
to the ArcGIS JavaScript library
jsapi.arcgis.sdk
-
URL to the ArcGIS JavaScript library SDK
jsapi.arcgis.css
-
URL to the ArcGIS JavaScript library CSS
A typical configuration of the JavaScript API URLs would look like this:
jsapi.arcgis=http://serverapi.arcgisonline.com/jsapi/arcgis?v=3.0 jsapi.arcgis.sdk=http://resources.esri.com/arcgisserver/apis/javascript/arcgis jsapi.arcgis.css= http://serverapi.arcgisonline.com/jsapi/arcgis/3.0/js/dojo/dijit/themes/tundra/tundra.css
Using View in ArcGIS.com Map link in the Services Directory you can view Map, Image and Feature Services in ArcGIS.com map viewer. By default Services Directory is configured to use the map viewer in www.arcgis.com. You can update the arcgis.com.map property to configure Services Directory to use a map viewer from a different portal. The arcgis.com.map.text property can be used to configure the text that will be shown for the View In link in the Services Directory.
arcgis.com.map=http://www.arcgis.com/home/webmap/viewer.html arcgis.com.map.text=ArcGIS.com Map
Logging in the REST API can be configured using the ArcGIS Server Manager.
Since 10.1 the maximum allowed size of a multipart request for uploading files is a service level property <MaxUploadFileSize>
. This limit, for example, applies to files uploaded using Uploads API or the Feature Service Add Attachment
and Update Attachment
operations. See section limiting Upload file size and file types to learn more.