Developing with ArcGIS Server: An Overview |
|
Release 9.3 |
As you learn and use ArcGIS Server, you'll probably reach the point where you want to build or customize an application outside Manager. ArcGIS Server offers several programming frameworks, or APIs, that you can use to create Web applications and services. The API that you choose depends on your experience and skill level, as well as the requirements of the application.
Following is a summary of the ways you can work with the server accompanied by the recommended skill level (beginner, intermediate, and advanced) for each one.
If you want to embed lightweight mapping functionality into a Web application, or if you're just getting started with ArcGIS Server development, consider using the ArcGIS JavaScript API. It's free to use and deploy applications built with this API. All you need is an ArcGIS Server available whose maps and tools you can use in your application. To get started, see the ArcGIS JavaScript API home page.
The ArcGIS JavaScript API is powered by a back-end REST API that is able to retrieve information statelessly from the server. When you run the application, the code runs in the browser instead of having to run on the server. This provides a quick and clean client experience. The ArcGIS JavaScript API is built on top of the Dojo JavaScript toolkit, so you don't have to worry about accommodating browser idiosyncrasies in your code; the framework handles it for you.
You can use the ArcGIS JavaScript API even if you have little or no coding experience. Copy and paste the example code into your HTML pages to add mapping functionality.
When writing applications with the ArcGIS JavaScript API, you'll need to provide the URLs to maps and other resources on your server. You can use the ArcGIS Services Directory to find out these Web addresses. For examples, see the Services Directory Help page at http://<server name>/<instance name>/SDK/REST/servicesdirectory.html.
ArcGIS Server also includes extensions for well-known online mapping APIs for JavaScript:
ArcGIS JavaScript Extension for the Google Maps API
This extension for the Google Maps API allows you to integrate your maps with the Google Maps base layers. You can perform query and geoprocessing tasks on your services and work with the results as features. You can also publish your content as a Google Mapplet.
To get started, see the ArcGIS JavaScript Extension for the Google Maps API home page.
ArcGIS JavaScript Extension for Virtual Earth
This extension for Microsoft Virtual Earth allows you to display your maps over the Virtual Earth base maps in 2D or 3D. You can perform query and geoprocessing tasks on your services and work with the results as VEShapes. You can also perform geocoding operations and view the results on the base map.
To get started, see the ArcGIS JavaScript Extension for Virtual Earth home page.
These two extensions can be useful if you're already familiar with the Virtual Earth or Google Maps APIs or you want to use the basemaps provided by these services. If you decide to use the ArcGIS JavaScript API, you can use the basemaps provided by ArcGIS Online.
Another way to include mapping, geocoding, and geoprocessing functionality in your Web applications is to use the ArcGIS API for Flex. This API gives you access to services published with ArcGIS Server 9.3 in applications that use the Adobe Flex framework. Like the JavaScript API, the Flex API works with the REST endpoints of the services.
To get started building GIS-enabled Flex applications, visit the ArcGIS API for Flex page on the ArcGIS Server Resource Center. Here you can cut and paste code from the online samples, read detailed conceptual help, or browse entries other developers have submitted to the Code Gallery.
If you want to build Web applications that leverage ASP.NET, or if your requirements exceed the capabilities of the JavaScript APIs, consider using the ArcGIS Server Web Application Developer Framework (ADF). The Web ADF provides tools and templates for developing .NET Web applications within Microsoft Visual Studio.
Once you install the Web ADF, you'll notice some of the following new things in Visual Studio:
If you've ever worked with any of Microsoft's integrated development environments before, you'll find adding GIS functionality to Web applications in Visual Studio to be much the same--you drag controls from a toolbox onto a form (in this case a Web form), set some control properties, and programmatically define how the control works by writing code that responds to events such as mouse clicks. With the Web ADF, in addition to adding text boxes and buttons, you can add things such as a map and a table of contents directly to your Web form. The Developer Help assumes that you are already familiar with this development environment and understand Web forms, Web controls, assemblies, namespaces, and so on.
The Web ADF comes with the Web Mapping Application which is a Visual Studio template. The Web Mapping Application has the appearance of an application built with Manager; however you do not have to go through the process of creating the application in Manager. You can deploy the Web Mapping Application as is without writing any additional code or use it as a starting point for creating a custom application. In some cases, you may want to use the code or files included with the Web Mapping Application as a guide for your own projects.
You can use the tools provided with the Web ADF to build a new Web application in Visual Studio without the use of a template or an application previously created in Manager. As you design your application, you can use the ADF Web controls that are added to the Visual Studio Toolbox. You can drag the controls onto your Web forms, set their properties, and write code to respond to the control's events or connect them with other controls on your form.
If you don't need to use the Web controls, or you want to go beyond the default functionality they provide, you can use the libraries provided with ArcGIS Server to programmatically connect to a server and work with the services running on it. Each of the libraries has an object model diagram that can help you visualize the classes in the library and their relationships. You can find the object model diagrams in the library reference section of the Developer Help.
The Web ADF is architected to support connections to multiple types of GIS services in Web applications and Web services. These include the following:
Not only can you access multiple types of GIS servers, but you can combine the GIS services running on those servers into one map. The Web ADF supports adding multiple map services to a single map display, allowing you to seamlessly integrate map services running on the same server or different servers of varying types. For example, you can combine a map service running on an ArcIMS server with one running on ArcGIS Server. This multiservice architecture allows you to transparently overlay map services.
Each type of service that the Web ADF supports has its own API. This means that if a map contains several different types of services, you may need to work with several APIs. For example, if your map combines an ArcGIS Server service and an ArcIMS service, you may need to program with both ArcObjects and the ArcIMS API. Fortunately, the ADF provides a common API for navigating and querying a map containing multiple service types. This means that for operations involving the entire map--such as zooming to a specific extent--you can write the code using the Web ADF convenience classes instead of writing the code in the API of each service type.
If you want to develop advanced features with a specific service type, the ADF provides a way to access the service's API in a .NET environment. For example, you can use the ArcIMS API to work with ArcIMS services using .NET classes. The Developer Help contains information about programming with multiple service types and how to access the APIs for each one.
In addition to the service types listed above, the Web ADF also supports adding graphics to a map. You can associate attributes with the graphics using standard .NET data tables. In many cases, using a Web ADF graphics layer provides a lightweight alternative to other more advanced means of storing data, such as programmatically creating a feature class.
The Web ADF is designed to be flexible so that you can customize the following:
The Toolbar control included with the ADF contains a default set of tools and commands used for map navigation and query. You can write code for your own tools and commands and add them to a toolbar. A common way to do this is to write the custom code in a class library, which you add to your Visual Studio project. You can then configure each tool and command to execute code in the class library.
The Web ADF includes a number of out-of-the-box tasks that you can add to your applications. These include tasks for query, network analysis, and editing. These tasks are all built from a common framework in the Web Controls library. You can use the same framework to develop your own task.
Learn more about working with tasks.
The Web ADF supports the display and query of multiple types of services, such as ArcGIS Server services, ArcIMS services, WMS services, and ArcWeb Services. In the context of the ADF, a service is a data source. The ADF contains a framework for developing support for your own types of data sources in addition to those listed above.
The ArcGIS family of products is built on a set of software objects called ArcObjects. The JavaScript APIs and the Web ADF provide higher-level frameworks that allow you to leverage the GIS server without having to worry about what is happening at the ArcObjects level. However, if you require the full power of ArcObjects, you can use the Connection Library included with the Web ADF and ArcGIS Engine to connect directly to the GIS server and work with the fine-grained ArcObjects API. This is how you might build a desktop client application or an application Web service that works with the GIS server.
An alternative to working with ArcObjects is to use the SOAP API. This is an appropriate choice when working with services that have Web access enabled (all ArcGIS Server services have Web access enabled by default). The SOAP API exposes much of the functionality of ArcObjects. You can work with the SOAP API through the Web ADF or through a non-ESRI solution such as the .NET SOAP Toolkit.
You can add to the functionality of the core services (map, geocode, geoprocessing, globe, geodata, and image) by building server object extensions, or custom coarse-grained ArcObjects classes. These are potentially very powerful but require extensive use of ArcObjects. Examples of server object extensions that you might already be familiar with include the Network Analyst capability and the WMS capability available with ArcGIS Server map services. The Developer Help contains information about how to build a server object extension in the topic Server object extensions.
If you're building applications that run on mobile devices, such as smartphones and Pocket PCs, you can use the Mobile ADF. If you're a beginner, you can use ArcGIS Server Manager to create your first mobile applications. If you want to extend these applications or create new ones, the Mobile ADF contains a set of controls and libraries that you can use within Microsoft Visual Studio.
The ArcGIS Server Developer Help contains conceptual information, sample applications, and step-by-step scenarios. The library reference contains more detailed help for each class and member, as well as object model diagrams. Updated versions of the latest help can be found on the ESRI Developer Network (EDN) Web site.
When you install the Web ADF, Developer Help is automatically installed. You can open Developer Help from the desktop or within Visual Studio.
To access Developer Help from the desktop, follow these steps:
To open Developer Help within Visual Studio:
The library reference includes brief descriptions of each class and member in the Web ADF. Some classes and members have extra remarks and code examples. Additionally, if an assembly has an object model diagram, you can find it in the library reference.
You can get to the library reference by following the steps above to open Developer Help. Once you click Creating ArcGIS Server solutions, you will see the Library reference node in the table of contents.
The ArcGIS Server Resource Center site at http://resources.esri.com/arcgisserver contains the most up-to-date versions of the Developer Help and library reference.
The ESRI User Forums contain an ArcGIS Server discussion area where you can communicate with other developers and provide peer-to-peer support.
The ArcGIS Server development team maintains a blog where you can find tips and samples beyond what's included in this help system. Topics include Web ADF development, performance and caching, service packs, upcoming conferences and seminars, and more.
The ArcGIS Server code galleries and ArcScripts are online resources for you to learn from other developers' code and share your own projects.
The code galleries are available through the ArcGIS Server Resource Center. Below are quick links to the code galleries for each API:
ArcScripts is a similar, older site where developers can exchange tools, samples, and utilities related to ESRI products.
Becoming familiar with the code galleries and ArcScripts can save you much time and effort if someone has already created the tool that you need. And if you've developed something useful, you can contribute it for others to download.