Table Of ContentArcGIS® Server Administrator and Developer Guide
ArcGIS® 9.1
PUBLISHED BY
ESRI
380 New York Street
Redlands, California 92373-8100
Copyright © 2004 ESRI ESRI, ArcView, ArcIMS, Spatial Database Engine, SDE, the ESRI globe
All Rights Reserved. logo, ArcObjects, ArcGIS, ArcMap, ArcCatalog, ArcScene,
Printed in the United States of America. ArcInfo, ArcEditor, ArcReader, ArcToolbox, 3D Analyst, ArcSDE,
GIS by ESRI, the ArcGIS logo, www.esri.com, and @esri.com are
The information contained in this document is the exclusive property of trademarks, registered trademarks, or service marks of ESRI in the
ESRI. This work is protected under United States copyright law and United States, the European Community, or certain other jurisdictions.
other international copyright treaties and conventions. No part of this
work may be reproduced or transmitted in any form or by any means, Other companies and products mentioned herein are trademarks or
electronic or mechanical, including photocopying and recording, or by any registered trademarks of their respective trademark owners.
information storage or retrieval system, except as expressly permitted in
writing by ESRI. All requests should be sent to Attention: Contracts
Manager, ESRI, 380 New York Street, Redlands, California 92373-8100,
USA.
The information contained in this document is subject to change without
notice.
CCCCCooooonnnnntttttrrrrriiiiibbbbbuuuuutttttiiiiinnnnnggggg WWWWWrrrrriiiiittttteeeeerrrrrsssss
Eric Bader, Euan Cameron,Chris Davies, Shelly Gill, Sean Jones,
Shubha Koneru, Andy MacDonald, Glenn Meister, Mike Minami,
Dan O’Neill, Andy Potts, Anne Reuland, Rohit Singh, Steve Van
Esch, Zhiqian Yu, Mark Zollinger
UUUUU.....SSSSS..... GGGGGOOOOOVVVVVEEEEERRRRRNNNNNMMMMMEEEEENNNNNTTTTT RRRRREEEEESSSSSTTTTTRRRRRIIIIICCCCCTTTTTEEEEEDDDDD/////LLLLLIIIIIMMMMMIIIIITTTTTEEEEEDDDDD RRRRRIIIIIGGGGGHHHHHTTTTTSSSSS
Any software, documentation, and/or data delivered hereunder is
subject to the terms of the License Agreement. In no event shall
the U.S. Government acquire greater than RESTRICTED/LIMITED
RIGHTS. At a minimum, use, duplication, or disclosure by the
U.S. Government is subject to restrictions as set forth in FAR
§52.227-14 Alternates I, II, and III (JUN 1987); FAR §52.227-19
(JUN 1987) and/or FAR §12.211/12.212 (Commercial Technical
Data/Computer Software); and DFARS §252.227-7015
(NOV 1995) (Technical Data) and/or DFARS §227.7202
(Computer Software), as applicable. Contractor/Manufacturer is ESRI,
380 New York Street, Redlands, California 92373-8100, USA.
Attribution.pmd 1 1/25/2005, 6:16 PM
Contents
CHAPTER 1: INTRODUCING ARCGIS SERVER.......................................................... 1
ArcGIS 9 developer overview..........................................................................................................2
ArcGIS Server overview.....................................................................................................................4
ArcGIS Server users............................................................................................................................7
ArcGIS Server capabilities...............................................................................................................11
ArcGIS Server developer kits.........................................................................................................14
Getting started..................................................................................................................................17
Using this book..................................................................................................................................19
ArcGIS developer resources..........................................................................................................21
CHAPTER 2: THE ARCGIS SERVER ARCHITECTURE...............................................27
ArcGIS software architecture.......................................................................................................28
ArcGIS Server architecture............................................................................................................33
The ArcGIS Server system..............................................................................................................35
Server objects.....................................................................................................................................40
ArcGIS Server security, impersonation, and identity...............................................................46
CHAPTER 3: ADMINISTERING AN ARCGIS SERVER ..............................................49
Getting started..................................................................................................................................50
Setting up and connecting to a GIS server...............................................................................52
Adding and removing server objects...........................................................................................58
Managing server objects.................................................................................................................62
Managing the server.........................................................................................................................65
CHAPTER 4: DEVELOPING ARCGIS SERVER APPLICATIONS...........................71
Programming ArcGIS Server applications..................................................................................72
ArcGIS Server APIs...........................................................................................................................75
Connecting to the GIS server.......................................................................................................84
Programming with server objects.................................................................................................87
Managing application session state..............................................................................................91
Working with server contexts....................................................................................................104
Web controls and the server API...............................................................................................111
Programming Web services...........................................................................................................114
ArcGIS Server application performance tuning.....................................................................121
Putting it all together: best practices........................................................................................133
CHAPTER 5: DEVELOPING WEB APPLICATIONS WITH .NET................135
The ArcGIS Server Application Developer Framework........................................................136
An overview of templates and Web controls.........................................................................137
Building your first Web applications..........................................................................................143
Guidelines for creating your own Web applications............................................................160
More about Web controls...........................................................................................................172
Map control......................................................................................................................................174
Page layout control........................................................................................................................184
Overview map control..................................................................................................................194
Toc control.......................................................................................................................................199
Toolbar control................................................................................................................................207
TOC.pmd 3 1/25/2005, 6:50 PM
CHAPTER 5 (CONTINUED)
Impersonation control..................................................................................................................215
North arrow control.....................................................................................................................218
Scale bar control.............................................................................................................................221
GeocodeConnection component.............................................................................................223
CHAPTER 6: DEVELOPING WEB APPLICATIONS WITH JAVA.................227
The ArcGIS Server Application Developer Framework........................................................228
An overview of the templates and Web controls.................................................................229
Building your first Web applications..........................................................................................236
Guidelines for creating your own Web applications............................................................257
More about Web controls...........................................................................................................262
Context control.............................................................................................................................265
Map control......................................................................................................................................274
Page layout control........................................................................................................................288
Overview control............................................................................................................................295
Toc control.......................................................................................................................................298
North arrow control.....................................................................................................................304
Scale bar control.............................................................................................................................307
Geocode control.............................................................................................................................310
Identify results control..................................................................................................................316
CHAPTER 7: DEVELOPER SCENARIOS................................................................321
Extending a Web application template (.NET).....................................................................322
Extending a Web application template (Java)........................................................................344
Developing an application Web service (.NET).....................................................................368
Developing an application Web service (Java).......................................................................385
Developing an ArcGIS Server Web service client (.NET)....................................................402
Developing an ArcGIS Server Web service client (Java)......................................................435
Extending ArcGIS Server with server-side libraries...............................................................463
APPENDIX A: SERVER LIBRARY................................................................................483
GISServerConnection class..........................................................................................................484
Server consumer objects..............................................................................................................485
ServerObjectManager class..........................................................................................................486
ServerContext class.......................................................................................................................488
ServerObject class..........................................................................................................................493
The Info classes...............................................................................................................................494
Server Administration Objects....................................................................................................497
ServerObjectAdmin class..............................................................................................................498
ServerObjectConfiguration class...............................................................................................511
ServerMachine class.......................................................................................................................517
ServerObjectType class.................................................................................................................518
ServerDirectory class.....................................................................................................................519
APPENDIX B: CONFIGURATION AND LOG FILES.....................................521
ArcGIS Server log files....................................................................................................................522
ArcGIS Server configuration files...............................................................................................528
iv • ArcGIS Server Administrator and Developer Guide
TOC.pmd 4 1/25/2005, 6:50 PM
APPENDIX C: DEVELOPING APPLICATIONS WITH EJBS.......................... 539
Enterprise JavaBeans and ArcGIS Server.................................................................................540
EJBs and ArcGIS Server—a developer scenario.....................................................................543
APPENDIX D: DEVELOPER ENVIRONMENTS.................................................575
The Microsoft Component Object Model.............................................................................576
Developing with ArcObjects........................................................................................................588
The Visual Basic 6 environment..................................................................................................597
The Visual Basic 6 development environment........................................................................610
Visual C++.........................................................................................................................................617
.NET application programming interface................................................................................659
Java application programming interface...................................................................................700
APPENDIX E: READING THE OBJECT MODEL DIAGRAMS.....................715
Object model key............................................................................................................................716
Classes and relationships..............................................................................................................717
Interfaces and members................................................................................................................720
Putting it together—An example..............................................................................................723
APPENDIX F: CONVERTING PERSONAL GEODATABASES...................... 725
Converting data for use with the GIS Server on UNIX.....................................................726
APPENDIX G: GLOSSARY...........................................................................................731
INDEX .................................................................................................................................747
Contents (cid:127) v
TOC.pmd 5 1/25/2005, 6:50 PM
TOC.pmd 6 1/25/2005, 6:50 PM
1
Introducing
ArcGIS Server
ESRI® ArcGIS® Server is a platform for building enterprise geographic information
system (GIS) applications that are centrally managed, support multiple users,
include advanced GIS functionality, and are built using industry standards. ArcGIS
Server manages geographic resources, such as maps, locators, and software
objects, for use by applications.
This chapter will introduce you to ArcGIS Server, how you use it, and its different
components. Topics covered in this chapter include:
(cid:127) an overview of ArcGIS 9 development (cid:127) the ArcGIS Server product (cid:127) what you
can do with ArcGIS Server (cid:127) the ArcGIS Server Developer Kits (cid:127) a description of
this book
Chapter1.pmd 1 1/25/2005, 5:43 PM
ARCGIS 9 DEVELOPER OVERVIEW
WHO SHOULD READ THIS BOOK?
This book will be of greatest use to programmers who want to use ESRI®
ArcGIS Server to build server applications, such as Web services and Web appli-
cations, that do simple mapping or that include advanced GIS functionality.
However, this book provides a general explanation of the use of ArcGIS Server
and the possibilities when building and deploying custom applications and solu-
tions. Several scenarios will illustrate, with code examples, some of the different
types of applications that can be developed with the ArcGIS Server and the
Application Developer Framework (ADF) developer kits.
This book will also be of use to ArcGIS Server administrators who need to
administrate aspects of an ArcGIS Server, such as its set of server objects and its
output directories.
ARCGIS 9 OVERVIEW
ArcGIS 9 is an integrated family of GIS software products for building a com-
plete GIS. It is based on a common library of shared GIS software components
called ArcObjects™. ArcGIS 9 consists of four key parts:
• ArcGIS Desktop—an integrated suite of advanced GIS applications.
• ArcGIS Engine—embeddable GIS component libraries for building custom
applications using multiple application programming interfaces (APIs).
• ArcGIS Server—a platform for building server-side GIS applications in enter-
prise and Web computing frameworks. Used for building both Web services
and Web applications.
• ArcIMS®—GIS Web server to publish maps, data, and metadata through open
Internet protocols.
2 • ArcGIS Server Administrator and Developer Guide
Chapter1.pmd 2 1/25/2005, 5:43 PM
ARCGIS 9 DEVELOPER OVERVIEW
Each of the GIS frameworks also includes the ArcSDE® gateway, an interface for
managing geodatabases in numerous relational database management systems
(RDBMSs).
ArcGIS 9 extends the system with major new capabilities in the areas of geopro-
cessing, 3D visualization, and developer tools. ArcGIS Engine and ArcGIS
Server, developer-centric products, make ArcGIS a complete system for applica-
tion and server development.
There is a wide range of possibilities when developing with ArcGIS. Developers
can:
• Configure/Customize ArcGIS applications such as ArcMap™ and ArcCatalog™
• Extend the ArcGIS architecture and data model
• Embed maps and GIS functionality in other applications with ArcGIS Engine
• Build and deploy custom desktop applications with ArcGIS Engine
• Build Web services and applications with ArcGIS Server
ArcGIS 9 has a common developer experience across all ArcGIS products
(Engine, Server, and Desktop). This book focuses on building and deploying
server applications using the ArcGIS Server. Developers wanting to customize
the ArcGIS Desktop applications or work with the ArcGIS Engine should refer
to the ArcGIS Desktop Developer Guide and ArcGIS Engine Developer Guide.
The ArcGIS system is built and extended
using software components called
ArcObjects. ArcObjects components are
software objects that have multiple devel-
oper APIs. These include Component
Object Model (COM), .NET, Java™, and
C++. Developers can use these APIs to
build applications that make use of
ArcObjects functionality. ArcObjects is at
the core of all the ArcGIS products:
ArcGIS Desktop, ArcGIS Engine, and
ArcGIS Server.
The ArcGIS Server provides a new set of
deployment options and resources for
developers as well as new and improved
tools for developers to work with. ArcGIS
Server is a set of the core ArcObjects and a
framework for running ArcObjects in a
server. The ArcGIS Server ADF is a set of
components and Web controls that allow
developers to build and deploy Web ser-
vices and Web applications that make use
of ArcObjects running within a server.
Chapter 1(cid:127) Introducing ArcGIS Server (cid:127) 3
Chapter1.pmd 3 1/25/2005, 5:43 PM
ARCGIS SERVER OVERVIEW
ArcGIS Server is a platform for building enterprise GIS applications that are
centrally managed, support multiple users, include advanced GIS functionality
and are built using industry standards. ArcGIS Server manages geographic re-
sources, such as maps, locators, and software objects, for use by applications.
Developers can use ArcGIS Server to build Web applications, Web services, and
other enterprise applications, such as those based on Enterprise JavaBeans™
(EJBs). Developers can use ArcGIS Server to build desktop applications that
interact with the server in client/server mode. ArcGIS Server also supports out-
of-the-box use by ArcGIS Desktop applications for server administration, simple
mapping, and geocoding over a local area network (LAN) or over the Internet.
HTML UI XML API
Application Server (.Net/J2EE)
Web
applications
Web services
Web
controls
ArcObjects library COM Java
.Net SOAP/XML
The ArcGIS Server consists of two components: a GIS server and an ADF for
.NET and Java. The GIS server hosts ArcObjects for use by Web and desktop
applications. It includes the core ArcObjects library and provides a scalable
environment for running ArcObjects in the server. The ADF allows you to build
and deploy .NET or Java desktop and Web applications that use ArcObjects
running within the GIS server.
The ADF includes a software developer kit (SDK) with software objects, Web
controls, Web application templates, developer help, and code samples. It also
includes a Web application runtime, which allows you to deploy Web applications
without having to install ArcObjects on your Web server.
4 (cid:127) ArcGIS Server Administrator and Developer Guide
Chapter1.pmd 4 1/25/2005, 5:43 PM
Description:Page 1. ArcGIS® 9.1. ArcGIS® Server Administrator and Developer Guide.