Data source mapping from the REST admin view for ArcGIS Spatial Data Server for the Java Platform

After you configure your data source and deploy your web application, you must provide a way for client applications, such as ArcGIS for Desktop, to communicate with your configured data source. To do this, create a data source mapping that includes the following information:

Server name

Name of the server

Database name

Name of the database

User name

Database user name

Data source name

Name of the configured data source

You can create this data source mapping from the spatial data server REST admin view before you publish a feature service from ArcGIS for Desktop.

In addition to creating a data source mapping from the REST admin view, you can validate and delete a data source mapping as well as get a list of data source mappings.

ArcGIS Spatial Data Server REST administrative end point URLs follow this pattern:

http://<server>:<port>/<webapp-context>/admin/datasources/<admin function>

Where:

For example, to create a data source mapping using the default application name context root (arcgis) on a server named strata, communicating through port 50000, the URL would be as follows:

http://strata:50000/arcgis/admin/datasources/createDatasourceMapping

This pattern is used for all the data source mapping REST administrative functions explained in this topic. You can choose either HTML or JSON as the form of your responses.

Create a data source mapping

Use createDatasourceMapping to create a mapping from a database connection used in ArcGIS for Desktop to a configured data source name.

Go to http://<server>:<port>/<webapp-context>/admin/datasources/createDatasourceMapping. Replace <server>, <port>, and <webapp-context> with the information appropriate to your site.

In this location, you will provide the following information:

Parameter

Description

Required?

Server Name

String representing the name of the server where the database management system is installed

This must be the same server you specified for the data source you configured.

Yes

Database Name

String representing the database

For Oracle, specify the name of the Oracle instance. For DB2, specify the database name or alias. For PostgreSQL, specify the database name.

This must be the same database you specified for the data source you configured.

Yes

User Name

String representing the user name required to connect to the database account referred to by this data source

This must be the same user you specified for the data source you configured.

Yes

Datasource Name

String referencing a preconfigured data source

Yes

You can choose in what format the response will be returned, either HTML or JSON.

JSON response format

Success:
  {"success" : true}
Failure:
  { "success": false,
  "error": {"description": "error description" }

Delete a data source mapping

Use deleteDatasourceMapping to delete an existing data source mapping.

Go to http://<server>:<port>/<webapp-context>/admin/datasources/deleteDatasourceMapping. Replace <server>, <port>, and <webapp-context> with the information appropriate to your site.

In this location, you will provide the following information:

Parameter

Description

Required?

Server Name

String representing the name of the server where the database management system is installed

Yes

Database Name

String representing the database

For Oracle, this is the Oracle instance name. For DB2, this is the database name or alias. For PostgreSQL, it is the database name.

Yes

User Name

String representing the user name required to connect to the database account referred to by this data source

Yes

You can choose in what format the response will be returned, either HTML or JSON.

JSON response format

Success:
  {"success" : true}
Failure:
  { "success": false,
  "error": {"description": "error description" }

Validate a data source mapping

Use validateDatasourceMapping to ensure that a data source with the given connection attributes was created successfully using the createDatasourceMapping call.

Go to http://<server>:<port>/<webapp-context>/admin/datasources/validateDatasourceMapping. Replace <server>, <port>, and <webapp-context> with the information appropriate to your site.

Parameter

Description

Required?

Server Name

String representing the name of the server where the database management system is installed

Yes

Database Name

String representing the database

For Oracle, this is the Oracle instance name. For DB2, this is the database name or alias. For PostgreSQL, it is the database name.

Yes

User Name

String representing the user name required to connect to the database account referred to by this data source

Yes

You can choose in what format the response will be returned, either HTML or JSON.

JSON response format

{"datasourceName" : "<datasourceName>"}

List data source mappings

Use listDatasourceMappings to return a list of all the available data source mappings on the specified server and port for that application name context root.

Go to http://<server>:<port>/<webapp-context>/admin/datasources/listDatasourceMappings. Replace <server>, <port>, and <webapp-context> with the information appropriate to your site.

The default response is HTML in a table containing a list of the connection attributes and data source names. You can choose JSON from the default HTML response.

JSON response format

{
  "serverName1:databaseName1:userName1": "<datasourceName1>",
  "serverName2:databaseName2:userName2": "<datasourceName2>",
  . . .
}

Related Topics

8/21/2012