![Page 1: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/1.jpg)
Extending ArcGIS for Server 10.1 services
Sterling Quinn @SterlingGIS
ArcGIS for Server: Product Engineer
![Page 2: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/2.jpg)
Session overview
• Introduction to server object extensions (SOEs)
• Do you need an SOE?
• Developing an SOE
• Deploying an SOE
• Getting help
![Page 3: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/3.jpg)
Introduction to SOEs
![Page 4: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/4.jpg)
What is an SOE?
• Server Object Extension
• Extends base functionality of ArcGIS Server using ArcObjects
• A class library you write in .NET or Java and deploy to your server
![Page 5: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/5.jpg)
SOEs are available when you create a service
![Page 6: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/6.jpg)
Advantages of SOEs
• Functional
• Fast
• Pluggable
• Consumable through REST web services
![Page 7: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/7.jpg)
Demo: Some SOEs in action
•Elevation profile
•Dynamic segmentation
![Page 8: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/8.jpg)
Detour: Alternatives to SOEs
![Page 9: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/9.jpg)
Building layouts for web printing
• Out-of-the-box PrintingTools service in 10.1
• Arcpy.mapping for advanced printing
![Page 10: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/10.jpg)
Changing symbols on the fly
• “Dynamic layers” capability at 10.1 - Specify drawing information as part of map service
request
• Client-side graphics with Web APIs’ FeatureLayer
![Page 11: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/11.jpg)
Web editing
• Feature service and the Web APIs
![Page 12: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/12.jpg)
Geoprocessing
• ModelBuilder published as geoprocessing service
• Python script tool as geoprocessing service
• Custom geoprocessing tool with .NET, C++, etc.
![Page 13: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/13.jpg)
Geometric calculations
• Geometry service
![Page 14: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/14.jpg)
When do you need an SOE?
• Need functions beyond out-of-the-box services
• Can’t or don’t want to use geoprocessing framework
• Leverage fast server-side processing using ArcObjects
![Page 15: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/15.jpg)
Developing an SOE
![Page 16: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/16.jpg)
Today we’ll focus on REST Web service SOEs
• Easily invoked by the Esri Web APIs - JavaScript - Flex - Silverlight - iOS - Etc.
![Page 17: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/17.jpg)
What you have to understand to develop an SOE
• .NET or Java technologies
• REST or SOAP communication
• ArcObjects
• Optional technologies for custom property pages - HTML and JavaScript for Manager pages - Java Swing or Windows Forms, and ArcCatalog
customization, for ArcCatalog pages
![Page 18: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/18.jpg)
Demo: Another SOE in action Spatial Query REST
![Page 19: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/19.jpg)
Steps for developing and deploying an SOE
1. Write the code 2. Optionally write a property page for Manager,
ArcCatalog, or both 3. Deploy the SOE 4. Publish a service and enable the SOE on it 5. Use the SOE in a client application you develop
![Page 20: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/20.jpg)
Writing the code
![Page 21: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/21.jpg)
An SOE implements the following interfaces
• IServerObjectExtension • IObjectConstruct (put initialization logic here) • IRESTRequestHandler *
* Other interfaces are used with SOAP and DCOM SOEs
![Page 22: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/22.jpg)
Getting started with the code
• REST SOE template in Visual Studio
• Installed with .NET ArcObjects SDK
• Has an example SOE stubbed out for you
![Page 23: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/23.jpg)
Visual Studio REST SOE template
Demo: A tour of the REST SOE template
![Page 24: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/24.jpg)
What happens in the template code
• Implements required interfaces
• Creates the schema
• Handles resources and operations
![Page 25: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/25.jpg)
ESRI.ArcGIS.SOESupport
• Helper classes - SoeRestImpl for REST - SoeSoapImpl for SOAP
• Allows for
- Message de/serialization - Error handling - Logging
![Page 26: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/26.jpg)
Creating the schema
• What resources and operations will your SOE expose?
- Resources give you back information - Operations do something
• Snap them together to make a schema
• You may need to diagram this
![Page 27: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/27.jpg)
SOE capabilities (or “Operations allowed”)
• Determine which schema items clients can access
• Configured as a parameter on schema items RestResource customLayerResource =
new RestResource("customLayers", true, CustomLayer, "GetInfo");
![Page 28: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/28.jpg)
Spatial Query REST SOE Find Near Features REST SOE
Demo: Exploring REST SOE schemas
![Page 29: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/29.jpg)
Writing handler functions
• Each resource and operation has a handler
• Operation handlers are where most of your business logic is invoked
![Page 30: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/30.jpg)
Working with JSON
• Your handlers have to… - Deserialize incoming JSON - Do something with it (often using ArcObjects) - Serialize the output into a JSON response
• Important class: ESRI.ArcGIS.SOESupport.JsonObject
![Page 31: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/31.jpg)
Serialization methods on SOESupport.JsonObject
• Deserialization (receiving a request)
• Serialization (preparing a response)
![Page 32: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/32.jpg)
Conversion methods on SOESupport.Conversion
• These are helpful with (de)serialization
![Page 33: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/33.jpg)
Deserialization in the SpatialQueryREST sample
![Page 34: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/34.jpg)
Serialization in the SpatialQueryREST sample
![Page 35: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/35.jpg)
Spatial Query REST SOE
Demo: JSON serialization
![Page 36: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/36.jpg)
Accessing map services
• Avoid MXD-specific ArcObjects (IMap, ILayer, etc.) - Carto object model
• Use IMapServerDataAccess to get at underlying data
of MSDs - IFeatureClass, IRaster, or ITable
![Page 37: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/37.jpg)
Spatial Query REST SOE
Demo: Map service access
![Page 38: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/38.jpg)
Deploying an SOE
![Page 39: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/39.jpg)
Deploying and enabling an SOE
• Browse to the .SOE file in Manager to deploy
• Edit any map service properties and check the SOE
• Manager provides text boxes for typing SOE properties
- Custom Manager and ArcCatalog property pages available
![Page 40: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/40.jpg)
Spatial Query REST SOE
Demo: Deploying and enabling an SOE
![Page 41: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/41.jpg)
Deploying an SOE in 10.0
![Page 42: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/42.jpg)
Registering the SOE on each SOC
• Sign and build the project
• Register on each SOC machine with this command: regasm <path to DLL> /codebase • SOC account needs access to DLL location
![Page 43: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/43.jpg)
Registering the SOE with ArcGIS Server
• Done through code using IServerObjectAdmin2.AddExtensionType()
• Re-use the registration app in the SOE SDK samples
• Verify registration by viewing <ArcGIS Server install>\server\system\ServerTypesExt.dat
![Page 44: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/44.jpg)
Using an SOE in a client application
![Page 45: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/45.jpg)
Using the SOE in a client application
• Use types designed for asynchronous HTTP requests to Web services
• Different techniques for JavaScript, Flex, and Silverlight
![Page 46: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/46.jpg)
JavaScript clients to REST SOEs
• Use esri.request
• Set up content variable with JSON inputs
• Pass content to esri.request, then work with the response object
• Online SDK has a sample
![Page 47: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/47.jpg)
Spatial Query REST SOE
Demo: Using an SOE in a JavaScript app
![Page 48: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/48.jpg)
Where can I get more help?
• Recording of this session will be on Resource Center
• SOE doc is in the ArcObjects SDK developer help
![Page 49: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/49.jpg)
Demo: Help for building SOEs and clients
![Page 50: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/50.jpg)
Download today’s demos
• esriurl.com/spatialqueryrest
• esriurl.com/milemarker
![Page 51: extending arcgis for server 10.1 services · 2014-06-04 · Session overview • Introduction to ... -Java Swing or Windows Forms, and ArcCatalog customization, for ArcCatalog pages](https://reader033.vdocuments.net/reader033/viewer/2022042809/5f8e100d76203f0666597049/html5/thumbnails/51.jpg)