You can use server object extensions (SOEs) in any application that can make an HTTP request to the server and parse the response. The inputs and outputs of SOEs are simple types, such as numbers, text strings, and XML and JSON objects. The consuming application doesn't need to have any understanding of the APIs used to implement the SOEs. It needs to prepare the inputs to send to the SOE and parse and understand the outputs returned from the SOE.
You'll often test your SOE in the ArcGIS REST Services Directory (assuming you are using a REST SOE), then write code to consume the SOE in your client application.
Testing your SOE in the Services Directory
The fact that you submit simple types to your SOEs allows you to test your REST web service SOEs in the Services Directory. After enabling the SOE on your map service, navigate to the service's page in the Services Directory. At the bottom of the page, you'll see the SOE listed under Supported Extensions. (If you don't see it, verify the ArcGIS Server administrator has cleared the REST cache.)
If you click the SOE in the Services Directory, you'll be able to click and explore the resources and operations you exposed. Click an operation and you'll see some input boxes that you can use to test the SOE requests and responses. You should get back a simple JSON or HTML response.
Using your SOE in a client application
When you expose your SOE as a REST web service, you can consume it in the Esri web and mobile APIs. No matter which API you use, working with your SOE web service requires the following:
-
Making a request from the web service—Involves building a list of parameters and sending the completed URL to the server
-
Doing something with the response—Requires understanding the format of the response and knowing how to parse the information to do something useful in your application
Although the coding patterns are similar, the classes that you use for working with SOEs vary in the ArcGIS Maps SDK for JavaScript. For example, in the API you set up a variable using JSON that holds all the input parameters for your SOE. You then use the esri.request() method to make the web service call. The response is a JSON object.