FRAMES | NO FRAMES
Configuring the REST API

Both the Java and .NET instances of the REST API work out-of-the-box without requiring special configuration. However, if you export and deploy the REST instance elsewhere, or if you needed to change the defaults, an understanding of the various configuration points is required.

From the API perspective, both Java and .NET instances are identical. However, given they are disparate platforms, they differ in their configuration settings and so are discussed separately.

Configuring the Java instance Configuring the .NET instance

Configuring the Java instance

The Java configuration consists of configuring two files:

ArcGIS Server Information

The information about the ArcGIS Server to connect to is configured in server.properties.

A typical server.properties file looks like the following:

com.esri.rest.HOST=myserver
com.esri.rest.DOMAIN=mydomain
com.esri.rest.USER_NAME=myusername
com.esri.rest.PASSWORD=mypassword
com.esri.rest.PASSWORD_ENCRYPTED=false
com.esri.rest.SOAP_URL=http://myserver:8399/arcgis/services
com.esri.rest.SOAP_HTTPS_URL=https://myserver:8343/arcgis/services
com.esri.rest.SECONDARY_HOSTS=myserver2,myserver3
com.esri.rest.SERVER_CLUSTER_TYPE=roundrobin

Google Maps Key

In order to view certain map services with the ArcGIS JavaScript Extension for the Google Maps API library directly from the Services Directory, you must obtain a Google Maps API Key from Google. The website URL you provide when signing up for this key should be the base URL of your Services Directory. For a default installation, the URL to provide for the key would be http://<host>:8399/arcgis/rest

Once you have obtained the key, you can configure it using the jsapi.gmaps.key property in rest-config.properties.

Services Directory Options

To disable Services Directory, you can set the config.services-directory-disabled property to true in rest-config.properties. This property is false by default. Note that you can disable and enable Services Directory at runtime as well by using the REST Admin.

REST Cache Options

The REST API caches information pertaining to catalogs and services to boost performance. The various cache configuration options you can set in rest-config.properties are discussed here.

Ports

You need to configure the properties pertaining to REST API ports only if you have a mix of standard (available over HTTP) and encrypted (available over HTTPS only) services. This is because if you have a mix of services, the Services Directory needs to generate full URLs for services and folders that are in the other scheme. On the other hand, if the services are all in the same scheme, Services Directory generates only relative URLs, thereby negating the need to configure the ports. The properties for ports are in rest-config.properties.

You can configure the standard HTTP port with the config.http-port property and the HTTPS port with the config.ssl-port property.

If you have a reverse proxy set up for accessing the REST API, you can configure the reverse proxy's standard HTTP port with the config.reverse-proxy-http-port property and the reverse proxy's HTTPS port with the config.reverse-proxy-ssl-port property.

A typical configuration of the port properties would look like this:

config.http-port=8399
config.ssl-port=8343
config.reverse-proxy-http-port=80
config.reverse-proxy-ssl-port=443

JavaScript API URLs

Services Directory gives you the ability to view map services in the three JavaScript libraries - ArcGIS JavaScript API, ArcGIS JavaScript Extension for the Google Maps API, and ArcGIS JavaScript Extension for Virtual Earth. You can configure the URLs to various resources for these libraries using the properties in rest-config.properties discussed here.

A typical configuration of the JavaScript API URLs would look like this:

jsapi.arcgis=http://serverapi.arcgisonline.com/jsapi/arcgis?v=1
jsapi.arcgis.sdk=http://resources.esri.com/arcgisserver/apis/javascript/arcgis
jsapi.arcgis.css=
http://serverapi.arcgisonline.com/jsapi/arcgis/1/js/dojo/dijit/themes/tundra/tundra.cssjsapi.ve=http://serverapi.arcgisonline.com/jsapi/ve?v=1
jsapi.ve.sdk=http://resources.esri.com/arcgisserver/apis/javascript/ve
jsapi.ve.terms=
http://www.microsoft.com/virtualearth/product/terms.htmljsapi.gmaps=http://serverapi.arcgisonline.com/jsapi/gmaps?v=1
jsapi.gmaps.sdk=http://resources.esri.com/arcgisserver/apis/javascript/gmaps
jsapi.gmaps.terms=http://code.google.com/apis/maps/terms.html

REST API Reference URLs

Services Directory provides context sensitive REST API Reference links on every page of the Services Directory. The URLs for these links can be configured in rest-config.properties and are discussed in this section.

The base.url property should point to the base URL of the REST API SDK. By default it points to the REST SDK installed with the server:

base.url=http://<host>:8399/arcgis/sdk/rest
Note that if you don't provide this property, the API Reference links are not displayed on the Services Directory pages.

All properties following the base.url property in the rest-config.properties file are relative URLs to the API reference topic for a resource or operation. For example, the mapserver=index.html?mapserver.html property is the relative URL to the API reference topic for the map service resource.

Tile Access

On certain platforms and configurations such as a distributed server configuration on certain Linux systems, there is a lag between the time when a dynamic tile is created and the time when the system makes it available for access. You can use the config.generated-tile-access-timeout property in rest-config.properties to set the maximum amount of time in seconds that the REST API cache will wait for a dynamically generated tile to be made available by the system before it returns with an HTTP 404. For example, if you want to set this timeout to 60 seconds, you should set config.generated-tile-access-timeout=60.


Configuring the .NET instance

The .NET configuration is stored in the rest.config file found in the root folder.

ArcGIS Server Information

The information about the ArcGIS Server to connect to is configured in the GISServer element of the rest.config file.

A typical GISServer element in the rest.config file looks like the following:

<GISServer>
  <ServerName>myserver</ServerName>
  <SoapUrl>http://myserver/arcgis/services</SoapUrl>
  <SoapSslUrl>https://myserver/arcgis/services</SoapSslUrl>
  <Identity>
    <EncodedString>slzH73QPaprcEFI/fL6Jco0fj6qp4MbccJJN+eP2wtU=</EncodedString>
  </Identity>
</GISServer>

Services Directory Options

To disable Services Directory, you can set the enabled attribute to false in the ServicesDirectory element. This property is true by default. Note that you can disable and enable Services Directory at runtime as well by using the REST Admin.

REST Cache Options

The REST API caches information pertaining to catalogs and services to boost performance. The various cache configuration options you can set in the Cache element of the rest.config file are discussed here.

A typical Cache element in the rest.config file looks like the following:

<Cache mode="manual">
  <Period>5</Period>
  <Time>00:00</Time>
</Cache>

Ports

You need to configure the properties pertaining to REST API ports only if you have a mix of standard (available over HTTP) and encrypted (available over HTTPS only) services. This is because if you have a mix of services, the Services Directory needs to generate full URLs for services and folders that are in the other scheme. On the other hand, if the services are all in the same scheme, Services Directory generates only relative URLs, thereby negating the need to configure the ports.

You can configure the standard HTTP port with the Port element and the HTTPS port with the SslPort property.

A typical configuration of the port properties would look like this:

<Port>80</Port>
<SslPort>443</SslPort>

JavaScript API

Services Directory gives you the ability to view map services in the three JavaScript libraries - ArcGIS JavaScript API, ArcGIS JavaScript Extension for the Google Maps API, and ArcGIS JavaScript Extension for Virtual Earth. You can configure the resources for these libraries using the JsApi child elements discussed here.

A typical configuration of the JavaScript API URLs would look like this:

  <JsApi>
    <ArcGIS>http://serverapi.arcgisonline.com/jsapi/arcgis?v=1</ArcGIS>
    <ArcGISSDK>http://resources.esri.com/arcgisserver/apis/javascript/arcgis</ArcGISSDK>
    <VE>http://dev.virtualearth.net/mapcontrol/mapcontrol.ashx?v=6.1</VE>
    <VEExtender>http://serverapi.arcgisonline.com/jsapi/ve?v=1</VEExtender>
    <VETerms>http://www.microsoft.com/virtualearth/product/terms.html</VETerms>
    <ArcGISVESDK>http://resources.esri.com/arcgisserver/apis/javascript/ve</ArcGISVESDK>
    <GMaps>http://maps.google.com/maps?file=api&v=2</GMaps>
    <GMapsExtender>http://serverapi.arcgisonline.com/jsapi/gmaps?v=1</GMapsExtender>
    <GMapsTerms>http://code.google.com/apis/maps/terms.html</GMapsTerms>
    <ArcGISGMapsSDK>http://resources.esri.com/arcgisserver/apis/javascript/gmaps</ArcGISGMapsSDK>
    <GMapsKey><!--GMaps key goes here--></GMapsKey>
  </JsApi>

REST API Reference URLs

Services Directory provides context sensitive REST API Reference links on every page of the Services Directory. The URLs for these links can be configured using the ApiHelp element which is discussed in this section.

The baseUrl attribute of the ApiHelp element should point to the base URL of the REST API SDK. By default it points to the REST SDK installed with the server:

baseUrl="http://<host>/arcgis/SDK/REST/index.html?"
Note that if you don't provide this property, the API Reference links are not displayed on the Services Directory pages.

All child elements of the ApiHelp element in the rest.config file contain relative URLs to the API reference topic for a resource or operation. For example, in the configuration snippet below, the Catalog element contains the relative URL to the API reference topic for the catalog resource.

  <ApiHelp baseUrl="http://myserver/arcgis/SDK/REST/index.html?">
    <Catalog>catalog.html</Catalog>
    ...
  </ApiHelp>