8 SOE Basics Can be developed for REST or SOAP Access KYTC has chosen to write them as REST servicesCan be written in .NET or JavaProvide access to the full suite of ArcObjects
9 SOE BasicsNeed to be deployed to all of a site’s ArcGIS Servers in multi-server configurationsThis TOTALLY changes at 10.1!Return information is in JSON but can be written to return other data formats.KYTC offers both JSON and XML
10 Advantages of a SOE Fast! Low server overhead Easily accessible SOE’s live and die with the map service they’re attached toNo performance hit for having to spin up an instance of the SOE when a request is madeEasily accessibleCan be accessed by any client that is able to make the request
12 When do you need a SOE? Other considerations… Geoprocessing services have a large memory footprint when compared to a SOE – especially for complex tasksIf the task is complex and is going to be heavily utilized you’ll want to use a SOE.applications…You have an ArcGIS Server application that needs some ArcObjects functionality not provided by one of the ArcGIS Server API’s
14 Development Prerequisites: Use the templates! Knowledge of .NET or Java developmentKnowledge of ArcObjectsUse the templates!ESRI has provided a SOAP and a REST Visual Studio project template to get you started.
15 Development Building blocks of an SOE ResourcesInformation returned back from the server for use by an operationESRI says to think of this as a read-only propertyOperationsSomething you ask the server to do with a resourceEvery SOE has at least one resource and one operation even if the resource doesn’t return anything
16 Development The RestResource class SOE Operations are associated with a RestResourceArgumentsThe SOE’s nameCollection?The Resource HandlerCapabilities (optional)A way to group subsets of operationsNote: Capabilities are called “Allowed Operations” when looking at the Capabilities tab under Service Properties in ArcCatalog.
17 Development The CreateRestSchema function Returns a RestResource Class This is where you define the SOE’s operations (RestOperation class)
18 Development The REST Resource Handler Byte Array An array of raw dataReturns information from the server back to the SOE for use by an operationFor KYTC’s Server Object Extensions we’ve set it up to not return anythingDEFINE BYTE ARRAY!
19 Development The RestOperation Class An individual operation in a SOE Identifies which Operation Handler will be invokedSpecifies inputsSpecify output typesOptionally specify a capability
20 Development The Rest Operation Handler Byte Array Handles and validates inputsWhere you should execute any ArcObjects code (here or in helper methods)Formats output in the specified format
21 Development Signing the assembly Signing the assembly with a strongly named key will let you place the assembly in the server’s GACGAC – Global Assembly CacheThe server-wide .NET assemblies Cache. Lets you run multiple versions of the same DLL side-by-side.
22 DevelopmentTestingOnce deployed an HTML Page is generated for the SOE in the REST services directory of the map service it is attached toGAC – Global Assembly Cache
24 Using SOE’s in a .NET Application Making the requestThe WebClient Class…Constructing the URL...The OpenReadCompleted event handler
25 Using SOE’s in a .NET Application The WebClient ClassProvides common methods for sending data to and receiving data from a resource identified by a URI. (MSDN web site)Constructing the URLProgrammatically construct the entire call and provide it to the WebClient
26 Using SOE’s in a .NET Application The OpenReadCompleted event handlerSynchronous or Asynchronous
27 Using SOE’s in a .NET Application Deserializing SOE outputCreating a Class to hold the outputThe DataContractJsonSerializerDEFINE SERIALIZE vs. DESERIALIZE
30 KYTC Permitting (KEPT) When a permit location is added, moved, or deleted the corresponding point is acted upon in SDEGenerate a list of all roads within a mile of a permit
31 KYTC Rail Crossing Inventory (RCI) Project Manager’s Toolbox Return detailed route information based on a spatial queryReturn location information in terms of County, Route, and Mile point.Data synchronizationWhen a rail crossing is updated in the RCI database the corresponding location is moved in SDEProject Manager’s ToolboxA SOE is used to return the boundaries of a project which is, in turn, used to zoom to the project extent.
32 KYTC GIS Branch Goals Integration with application developers Deploy a spatially enabled application that is a joint effort between the GIS Branch and Application Development by the end of (DONE!)Deploy a spatially enabled application that is solely developed by Application Development with the GIS Branch only in an advisory role by the end of 2013.Replace existing web services with SOEsArcGIS server 10.1 no longer supports local connections