Developing with ArcGIS for Server


Summary
This topic focuses on how to work with ArcObjects in .NET using ArcGIS for Server. The Web Application Developer Framework (ADF) and Mobile ADF provide additional developer components for working in a specific application environment. In both products, the ArcObjects application programming interface (API) can be used when accessing ArcGIS Server data sources.

Local (DCOM) connections are only supported for ArcGIS Server versions prior to 10.1.

About ArcObjects

ArcObjects is a library of Component Object Model (COM) components that make up the foundation of ArcGIS. To work with ArcObjects in the .NET development environment, a collection of .NET primary interop assemblies (PIAs) and COM object libraries have been generated to manage .NET–COM interaction. ArcObjects components are installed with the ArcGIS for Desktop, ArcGIS Engine, or ArcGIS for Server products. They can be accessed locally on any machine where they have been installed.
To access ArcObjects remotely using ArcGIS for Server (via distributed COM or Distributed Component Object Model [DCOM]), only the .NET PIAs and COM object libraries must be installed on the client machine. The COM object libraries act as proxies to ArcObjects components on a remote server. ArcGIS for Server provides the environment to work with and manage ArcObjects remotely, via ArcGIS Server. Both the Web ADF and Mobile ADF for the Microsoft .NET Framework include the .NET PIAs and ArcObjects proxies. 

Building applications with ArcGIS for Server

You can build a number of different types of applications using ArcGIS for Server. If you are working with the ArcGIS for Server ArcObjects API using the Microsoft .NET Framework, you can build server applications, such as Web applications, Web services, desktop client applications, and mobile applications. If you are using ArcGIS Engine, you can build desktop applications that work with ArcObjects both locally and remotely via ArcGIS for Server. If you are using ArcGIS for Desktop, you can extend ArcGIS for Desktop applications to include functionality that uses the geographic information system (GIS) server. In both cases, the deployment of the application requires an ArcGIS Engine for windows deployment license or an ArcGIS for Desktop license, respectively.
With ArcGIS for Desktop and ArcGIS Engine, if you write desktop applications that use the server, you must have ArcObjects installed locally on the machine where the application is developed and deployed. When using these products to write applications that use ArcGIS for Server, you must follow the same programming guidelines as a developer using ArcGIS for Server to build a server application, such as a Web application that is deployed on a Web server. The only difference is that in the case of the desktop application, each instance of the application is bound to a single user session (though there might be multiple instances of your application running at any time), while Web applications and Web services are multiuser and multi-session applications.

Proxy objects

The Web ADF for the Microsoft .NET Framework does not include ArcObjects components. Instead, the ADF includes .NET PIAs and ArcObjects COM object libraries, also known as proxy objects. Applications that are built and deployed using the Web ADF must follow the coding guidelines of the server, or they will not work. 
A proxy object is a local representation of a remote object. The proxy object controls access to the remote object by forcing all interaction with the remote object to be via the proxy object. The supported interfaces and methods on a proxy object are the same as those supported by the remote object. You can make method calls on, and get and set properties of, a proxy object as if you were working directly with the remote object.
The following illustration shows the proxy object application process:

Programming with ArcObjects in ArcGIS for Server

Programming with ArcObjects using ArcGIS for Server is based on programming ArcObjects remotely. Programming ArcObjects remotely is the same as programming ArcObjects for use in desktop applications, but the following are additional details and programming guidelines of which you need to be aware:
  • How to connect to the server
  • How to get objects that are running in the server
  • How to create new objects in the server
  • The best ways to work with remote ArcObjects
The balance of programming on the server involves programming ArcObjects.
As an ArcGIS for Server developer, you have access to the Web ADF and if you choose, ArcObjects on the server. While the Web ADF provides Web controls and convenience classes to work with multiple data sources, it might be necessary to work with functionality only available in ArcObjects via ArcGIS Server. The Web ADF provides access to ArcGIS Server via Internet connections (Simple Object Access Protocol [SOAP] Web services) or local connections (server object manager [SOM] services).   
For client applications that want to work with ArcGIS Server using ArcObjects, a local connection must be established, which means you must have access to a service's server object via the SOM. 
In general, you can build almost any application type and work only with ArcGIS Server via the ArcObjects as long as you have access to the ArcObjects .NET PIAs and COM proxies. Building practical applications requires knowledge of the ArcObjects libraries exposed by ArcGIS Server. The libraries available in ArcGIS Server are summarized later in this topic.
The illustrations in this section show the library architecture of ArcGIS Server. Understanding the library structure and its dependencies and basic functionality helps you navigate through the ArcGIS Server components. The libraries are discussed in dependency order.
The following illustration shows libraries 1 through 13, using a number in the upper right corner of the library block. Libraries 14 through 21 are shown in the illustration at the end of this topic.
For a comprehensive guide to all of the libraries in the developer Help system, see ArcObjects namespaces.
Object libraries are logical collections of the programmable ArcObjects components, ranging from fine-grained objects (for example, individual geometry objects) to coarse-grained objects, which aggregate logical collections of functionality (for example, an ArcMap object to work with map documents). You can use a number of standards-based APIs (COM, .NET, Java, and C++) to work with ArcObjects on the server. These libraries are also used to program with ArcGIS for Desktop and ArcGIS Engine.

System

The System library is the lowest level library in the ArcGIS architecture. This library contains components that expose services used by the other libraries composing ArcGIS. There are a number of interfaces defined in the System library that you can implement. Developers do not extend this library; however, they can extend the ArcGIS system by implementing interfaces in this library.

SystemUI

The SystemUI library contains the interface definitions for user interface (UI) components that can be extended in the ArcGIS system. These include the ICommand, ITool, and IToolControl interfaces. Objects in this library are utility objects that simplify some UI developments. Developers do not extend this library; however, they can extend the ArcGIS system by implementing interfaces in this library.

Geometry

The Geometry library handles the geometry or shape of features stored in feature classes or other graphical elements. The fundamental geometry objects with which most users interact are point, multipoint, polyline, and polygon. In addition to those top-level entities, there are geometries that serve as building blocks for polylines and polygons. These are the primitives that compose the geometries. They are segments, paths, and rings. Polylines and polygons are composed of a sequence of connected segments that form a path. A segment consists of two distinguished points—the start and the end points—and an element type that defines the curve from start to end. The types of segments are CircularArc, Line, EllipticArc, and BézierCurve. All geometry objects can have Z, M, and IDs associated with their vertices. The fundamental geometry objects all support geometric operations, such as buffer and clip. The geometry primitives are not extended by developers.
Entities in a GIS refer to real-world features; the location of these real-world features is defined by a geometry and a spatial reference. Spatial reference objects, for both projected and geographic coordinate systems, are included in the Geometry library. Developers can extend the spatial reference system by adding new spatial references and projections between spatial references.

Display

The Display library contains objects used for the display of GIS data. In addition to the main display objects responsible for output of the image, the library contains objects that represent symbols and colors used to control the properties of entities drawn on the display. This library also contains objects that provide the user with visual feedback when interacting with the display. Developers most often interact with Display through a view similar to those provided by the Map or PageLayout objects. All parts of the library can be extended; commonly extended areas are symbols, colors, and display feedbacks.

Server

The Server library contains objects that allow you to connect and work with ArcGIS servers. You can access an ArcGIS server using the GISServerConnection object. The GISServerConnection object gives access to the SOM. Using this object, you can work with ServerContext objects to manipulate ArcObjects running on the server. The Server library is not extended by developers. Developers can also use the GISClient library when interacting with the ArcGIS server.

Output

The Output library is used to create graphical output to devices, such as printers and plotters, and hardcopy formats such as enhanced metafiles and raster image formats (.jpg, .bmp, and so on). You can use objects in this library with other aspects of the ArcGIS system (typically objects from the Display and Carto libraries) to create graphical output. Developers can extend the Output library for custom devices and export formats.

GeoDatabase

The GeoDatabase library provides the programming API for the geodatabase. The geodatabase is a repository of geographic data built on standard industry and object relational database technology. Objects in this library provide a unified programming model for all supported data sources in ArcGIS. The GeoDatabase library defines many of the interfaces that are implemented by data source providers higher in the architecture. The GeoDatabase library can be extended by developers to support specialized types of data objects (for example, features, classes, and so on). In addition, it can have custom vector data sources added using the PlugInDataSource objects. The native data types supported by the geodatabase cannot be extended.

GISClient

The GISClient library allows you to consume Web services provided by ArcIMS and ArcGIS Server. This library includes objects for connecting to GIS servers to make use of Web services. There is support for ArcIMS Image and Feature Services. The GISClient library provides a common programming model for working with ArcGIS Server objects in a stateless manner either directly or through a Web service catalog. The ArcObjects components running on ArcGIS Server are not accessible through the GISClient library. To gain direct access to ArcObjects components running on the server, use functionality in the Server library.

DataSourcesFile

The DataSourcesFile library contains the implementation of the GeoDatabase API for file-based data sources. These file-based data sources include shapefile, coverage, triangulated irregular network (TIN), computer-aided drafting (CAD), smart data compression (SDC), and vector product format (VPF). The DataSourcesFile library is not extended by developers.

DataSourcesGDB

The DataSourcesGDB library contains the implementation of the GeoDatabase API for database data sources. These data sources include Microsoft Access and relational database management systems (RDBMSs) supported by ArcSDE—IBM DB2, Informix, Microsoft SQL Server, and Oracle. The DataSourcesGDB library is not extended by developers.

DataSourcesOleDB

The DataSourcesOleDB library contains the implementation of the GeoDatabase API for Microsoft Object Linking and Embedding database (OLE DB) data sources. This library is only available on the Microsoft Windows operating system. These data sources include any OLE DB-supported data provider and text file workspaces. The DataSourcesOleDB library is not extended by developers.

DataSourcesRaster

The DataSourcesRaster library contains the implementation of the GeoDatabase API for raster data sources. These data sources include RDBMSs supported by ArcSDE—IBM DB2, Informix, Microsoft SQL Server, and Oracle—along with supported Raster Data Objects (RDO) raster file formats. Developers do not extend this library when support for new raster formats is required; rather, they extend RDO. The DataSourcesRaster library is not extended by developers.
An RDO is a COM API that provides display and analysis support for file-based raster data.

GeoDatabaseDistributed

The GeoDatabaseDistributed library supports distributed access to an enterprise geodatabase by providing tools for importing data into and exporting data out of a geodatabase. The GeoDatabaseDistributed library is not extended by developers.

Carto

The Carto library supports the creation and display of maps. These maps can consist of data in a map or a page with many maps and associated marginalia. The PageLayout object is a container for hosting one or more maps and their associated marginalia, for example, north arrows, legends, scale bars, and so on. The Map object is a container of layers. The Map object has properties that operate on all layers in the map—spatial reference, map scale, and so on—along with methods that manipulate the map's layers.
There are many types of layers that can be added to a map. Individual data sources often have an associated layer responsible for displaying the data on the map—vector features are handled by the FeatureLayer object, raster data by the RasterLayer, TIN data by the TinLayer, and so on. Layers can, if required, handle the drawing operations for their associated data, but it is more common for layers to have an associated Renderer object. The properties of the Renderer object control how the data displays in the map. Renderers commonly use symbols from the Display library for the actual drawing; the renderer matches a particular symbol with the properties of the entity that is to be drawn.
A Map object, along with a PageLayout object, can contain elements. An element has geometry that defines its location on the map or page, along with behavior that controls the display of the element. There are elements for basic shapes, text labels, complex marginalia, and so on. The Carto library also contains support for map annotation and dynamic labeling.
Although you can use the Map or PageLayout objects directly in your applications, it is more common to use a higher level object, such as MapControl or PageLayoutControl, or an ArcGIS application. These higher level objects simplify some tasks, and they provide access to the lower level Map and PageLayout objects, allowing you fine control of the objects.
The Map and PageLayout objects are not the only objects in Carto that expose the behavior of map and page drawing. The MxdServer and MapServer objects support the rendering of maps and pages, but instead of rendering to a window, these objects render directly to a file.
ArcGIS Server uses the MapServer object to work with a map.
Using the MapDocument object, you can persist the state of the map and page layout in a map document (.mxd), which can be used in ArcMap or one of the ArcGIS controls.
The Carto library is commonly extended in a number of areas. Custom renderers, layers, and so on, are common. A custom layer is often the easiest method of adding custom data support to a mapping application.

Location

The Location library contains objects that support geocoding and working with route events. The geocoding functionality can be accessed through fine-grained objects for full control, or the GeocodeServer objects offer a simplified API. You can create your geocoding objects. The linear referencing functionality provides objects for adding events to linear features and rendering these events using a variety of drawing options. Developers can extend the linear reference functionality.

NetworkAnalyst

The NetworkAnalyst library contains objects for working with network datasets. A license for the Network Analyst extension is required to use objects in this library. Developers can extend this library by creating new network servers.

NetworkAnalysis

The NetworkAnalysis library provides objects for populating a geodatabase with network data and objects to analyze the network when it is loaded in the geodatabase. This library works with utility networks, such as gas lines, electricity supply lines, and so on. Developers can extend this library to support custom network tracing.

GeoAnalyst

The GeoAnalyst library contains objects that support core spatial analysis functions. These functions are used in the SpatialAnalyst and 3DAnalyst libraries. A license for either the ArcGIS Spatial Analyst extension or ArcGIS 3D Analyst extension is required to use objects in this library. Developers can extend this library by creating a new type of raster operation.

3DAnalyst

The 3DAnalyst library contains objects for working with three-dimensional (3D) scenes in a similar way that the Carto library contains objects for working with two-dimensional (2D) maps. The Scene object is one of the main objects of the library since it is the container for data similar to the Map object. The Camera and Target objects specify how the scene is viewed regarding the positioning of the features relative to the observer. A scene consists of one or more layers; these layers specify the data in the scene and how the data is drawn. A license the ArcGIS 3D Analyst extension is required to work with objects in this library. It is not common for developers to extend this library.

GlobeCore

The GlobeCore library contains objects for working with globe data in a similar way that the Carto library contains objects for working with 2D maps. The Globe object is one of the main objects of the library since it is the container for data similar to the Map object. The GlobeCamera object specifies how the globe is viewed regarding the positioning of the globe relative to the observer. The globe can have one or more layers; these layers specify the data on the globe and how the data is drawn. A license for the ArcGIS 3D Analyst extension is required to work with objects in this library. It is not common for developers to extend this library.

SpatialAnalyst

The SpatialAnalyst library contains objects for performing spatial analysis on raster and vector data. A license for the ArcGIS Spatial Analyst extension is required to work with objects in this library. Developers most commonly consume objects in this library and do not extend it. See the following illustration: