The purpose of this sample is to show how to use a REST server object extension (SOE) that has one subresource and several properties. This sample also includes custom property pages for ArcMap and ArcGIS Manager.
The subresource, called layers, is a list of all layers accessible through the associated map service. The SOE has several properties that affect its behavior at run time, such as layerType, which dictates the types of layers the layers subresource will return. Other properties exist to showcase use of a property page in ArcMap and ArcGIS Server Manager.
Language: C#
Subject: Server
Organization: Esri, http://www.esri.com
Date: 3/28/2017
ArcObjects SDK: 10.5
Visual Studio: 2013, 2015
.NET Target Framework: 4.5
- ArcObjects .NET API Reference online
- Sample Data Download
- What's new
- Download the ArcObjects SDK for .Net from MyEsri.com
- Deploy the NetSimpleRESTSOEWithProperties.soe file to the server.
- Enable the SOE on a map service of your choice. Ensure that the map service has at least one feature layer and one raster layer.
- After the map service has started with the SOE enabled on it, open the Services Directory and access the http://:6080/arcgis/rest/services page.
- Click the map service on which you enabled your SOE.
- Scroll down and click NetSimpleRESTSOEWithProperties listed in the Supported Extensions section. If your REST SOE isn't listed here, log in to the Services Directory as an administrator and clear the REST cache. Repeat steps 3, 4, and 5 as needed.
- The NetSimpleRESTSOEWithProperties web page displays the root resource details, such as name and description, along with the Child Resources and Supported Operations sections.
- Click the layers subresource. It displays information about all the features layers in JSON format.
- Modify the value of the layerType property so that the layers subresource returns only raster layers. Log in to ArcGIS Server Manager and edit the map service on which you enabled the SOE. On the map service's editing page, click Capabilities, then click Simple REST SOE With Properties. A section called Properties will appear below the SOE. This is a custom property page created for Manager.
- Modify other property values as necessary and click Save and Restart.
- Access the layers subresource and verify that only raster layers are being returned.
- Copy NetSimpleRESTSOEWithProperties.Cat.dll to C:\Temp.
- Open the command line window. Navigate to the \Program Files (x86)\Common Files\ArcGIS\bin folder and type ESRIRegAsm.exe C:\Temp\NetSimpleRESTSOEWithProperties.Cat.dll /p:Desktop. Wait for confirmation of successful registration.
- Connect to your ArcGIS server in the ArcCatalog window of ArcMap. Open the service properties of the map service on which you enabled the SOE.
- Click the ".NET Simple REST SOE With Properties" extension. The layerType and other properties will be displayed in a properties dialog box in the Service Editor.
- Modify this property value by choosing one of the layer types, then click OK.
- After the service has restarted, check the layers subresource. It will display layers of the type you chose in the Service Editor dialog box in ArcMap.
- When your test is done, open the command line window again. Navigate to the \Program Files (x86)\Common Files\ArcGIS\bin folder and type ESRIRegAsm.exe /u C:\Temp\NetSimpleRESTSOEWithProperties.Cat.dll /p:Desktop. Wait for confirmation of successful unregistration.
Development licensing | Deployment licensing |
---|---|