Migrating a 10.0 Java server object extension to later versions
Java server object extensions (SOEs) that you develop with ArcGIS 10.1 are usable within 10.2 and later versions. However, migrating an SOE developed for ArcGIS Server 10.0 to 10.1 and later versions requires some modifications to the SOE's source code. This topic discusses the required modifications and describes a new Eclipse wizard for exporting Java SOEs. It also explains the absence of the SOEManager tool at ArcGIS versions 10.1 and later.
-
Modify your SOE's ServerObjectExtProperties Java annotation.
When an SOE is created using the Eclipse SOE creation wizard, the generated code includes a Java annotation called ServerObjectExtProperties, which holds metadata for the SOE. At ArcGIS 10.0, this annotation had the following attributes:
- displayName—User-friendly display name of SOE
- description—Multiline description of the SOE
- defaultSOAPCapabilities and allSOAPCapabilities—Capabilities of the SOE
- properties—Properties of the SOE as name = value pairs
- supportsMSD—Flag to indicate that SOE supports MSD-based services
At ArcGIS 10.1 and later versions, with the introduction of service definition-based map services, the supportsMSD attribute is no longer required and has been removed. All other attributes remain unchanged. You must therefore modify your ArcGIS 10.0 Java SOE's ServerObjectExtProperties annotation to look similar to the following to work at ArcGIS 10.1 and later:
@ServerObjectExtProperties(displayName = "Simple REST SOE", description = "My Simple REST Server Object Extension.", defaultSOAPCapabilities = "", allSOAPCapabilities = "", properties = "")
- Modify the SOE to use
ArcGIS Server 10.1 and later version map or image services.
ArcGIS versions 10.1 and later do not support map or image services based directly on MXD documents; instead, service definitions are used on the back end.
You will therefore use the com.esri.arcgis.carto.IMapServerDataAccess interface to access layers available via a map or image service at ArcGIS 10.1 and later. The following code snippet demonstrates how to obtain a handle to a feature class exposed as a layer via a service definition-based map service:
IServerObjectHelper soh = . . .; //accessible to SOEs at runtime IMapServerDataAccess mapServerDataAccess = (IMapServerDataAccess)soh.getServerObject(); IMapServer3 ms = (IMapServer3) mapServerDataAccess; String mapName = ms.getDefaultMapName(); int layerId = . . .;//integer id of the feature layer you are interested in accessing FeatureClass fc = new FeatureClass(mapServerDataAccess.getDataSource(mapName, layerId));