Simple REST SOE Sample


Purpose
The purpose of this sample is show use of a Java REST Server Object Extension that has 1 sub-resource and 1 operation.
The sub-resource, called "layers" is a list of layers of all types accessible through the associated map service. The operation, called "getLayerCountByType" that takes in a string "type" and returns a count of all layers of specified type. Acceptable values for type are "feature", "raster", "dataset", or "all". 

How to use

See How to use ArcGIS samples for help on running the sample.

How to use this sample?
  1. Deploy the lib/JavaSimpleRESTSOE.soe file to Server. For instructions on how to deploy an SOE to ArcGIS 10.1 Server, please see the "Developing Extensions" -> "Server Object Extensions" -> "Deploying and Un-deploying SOEs" topic in the ArcGIS Java Developer Help.
  2. Enable the SOE on map service of your choice. For instructions on how to enable SOE on a map service, please see the "Developing Extensions" -> "Server Object Extensions" -> "Enabling and Disabling SOEs" topic in the ArcGIS Java Developer Help. Please ensure that the map service has at least 1 feature layer.
  3. After the map service has started with SOE enabled on it, open up Services Directory and access the http://<server name>:6080/arcgis/rest/services page
  4. Click on the map service you enabled your SOE on.
  5. Scroll down and click on the JavaSimpleRESTSOE listed in "Supported Extensions" section. If you don't find your REST SOE listed here, please log in as admin into the Services Directory and clear the cache. Repeat steps 3,4, and 5.
  6. The JavaSimpleRESTSOE web page displays the root resource details such as name and description, along with the "Child Resources" and "Supported Operations" sections.
  7. Click on the “layers” subresource. It displays information about all layers in JSON format.
  8. Navigate back to the root resource page and click on the “getLayerCountByType” operation.
  9. Enter “feature” in the layerType field and click the "getLayerCountByType(GET)" or "getLayerCountByType(POST)" button. A JSON response will include the number of feature layers. Test this operations with other types such as “raster”, “dataset”, or “all”.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

soe/JavaSimpleRESTSOE.java The Simple REST SOE Java Server Object Extension class.
lib/JavaSimpleRESTSOE.soe The .soe file that contains this Server Object Extension




Development licensing Deployment licensing
Server Server