This document is archived and information here might be outdated.  Recommended version.


How to enable and test the REST SOE on a service (ArcObjects .NET 10.8 SDK)
ArcObjects Help for .NET developers > ArcObjects Help for .NET developers > Developing with ArcGIS > Extending ArcGIS Server > Developing server object extensions > Developing REST server object extensions > Walkthrough for creating a REST server object extension > How to enable and test the REST SOE on a service

How to enable and test the REST SOE on a service


Enabling and testing the REST SOE on a service

Once your server object extension (SOE) and property page is registered, you can enable the SOE on a service. In this section of the walkthrough, you'll publish a map service from the Yellowstone sample data in the .NET ArcObjects software development kit (SDK). You'll enable the SOE on the map service and test the SOE using the Services Directory.
The following instructions explain how to package the Yellowstone map into a service definition and publish that service definition using Manager. These steps are included because they support a variety of potential server architectures under which you might be trying this walkthrough.
  1. Start ArcMap and click File > Open.
  2. Browse to or type the location of Yellowstone.mxd, which is located in <ArcGIS developer kit install location>\Samples\data\Yellowstone.
  3. Click File > Share As > Service.
  4. Click "Save a service definition file" and click Next.
  5. Choose "No available connection" and check "Include data in service definition when publishing".
  6. Change the Server type to ArcGIS Server.
  7. Leave the Service name as Yellowstone and click Next.
  8. Choose a location where you want to save the service definition, then click Continue.
  9. Click Stage to create the service definition. In the success message, note the path of your service definition (.sd).
  10. Copy the Yellowstone.sd file to the machine running ArcGIS Server Manager.
  11. On the machine running ArcGIS Server Manager, log in to Manager and click Services.
  12. If necessary, click the Manage Services tab.
  13. Click Publish Service.
  14. Click Browse, browse to the location of Yellowstone.sd, and click Open. Then click Next.
  15. Accept the default properties for the service by clicking Next.
  16. In the list of available capabilities, find your Spatial Query REST SOE and check the box to enable it. Then click Publish. This creates the service.
  17. In the list of running services, click the name of your Yellowstone service.
  18. Click Capabilities and click Spatial Query REST (be careful not to uncheck the box). You are now viewing the properties page for the service. Ensure that the LayerName is "veg" (no quotes) and that the FieldName is "PRIMARY_" (no quotes).
  19. If you had to make changes to the LayerName and FieldName properties, click Save and Restart. Your SOE is now enabled and the properties set. You can easily test it using the Services Directory.
  20. Access your services directory by opening http://<server name>:6080/arcgis/rest/services in a web browser.
  21. Click Yellowstone, scroll down to the bottom of the page, and click SpatialQueryREST. You're now at the root resource page of your SOE.
  22. Click the one operation available, SpatialQuery. You can test this operation by adding some simple JavaScript Object Notation (JSON) parameters in the input boxes.
  23. Type {x:544000,y:4900000} in the location box.
  24. Type 5000 in the distance box.
  25. Click the SpatialQuery (GET) button.
You should see a long JSON response containing the clipped polygon geometries from the spatial query. Scroll to the bottom of the response and you'll see a list of the total areas for each vegetation type. This information structure isn't easy to read for a human, but it's great for a web browser or application programming interface (API). In the next section of the walkthrough, you'll learn how to put this information in maps and tables in a web application.


See Also:

Walkthrough: What's in the REST SOE
How to develop the REST SOE
How to deploy the REST SOE
How to develop a property page for the REST SOE
How to use the REST SOE in a Web application
Sample: Spatial Query REST SOE