Building Web Services using ArcGIS Server
Access web services through simple APIs
Michele Lundeen & Steve Mulberry
SERUG 2008
Agenda
ArcGIS Server GIS services
APIs SOAP, ArcObjects, REST
Service Types and Capabilities
Web Enabling
Demonstration - Publish, Enable, Test
SOAP web services
Definitions of Components
Demonstration Developer consuming GIS Services via SOAP
ArcObjects functioanlity exposed via a web services
Demonstration Calling ArcObjects functionality via a web service
Consuming Web Services with New 9.3 APIs
Demonstrations
How to get started?
Training
Helpful Links
ArcGIS Server - Web Services
ArcGIS Server GIS services
SOAP API
ArcObjects API
REST API and JavaScript API
How to get started?
What are ESRI GIS Services?
Out - of - Box
Mapping (2D & 3D)
Mobile
KML
Geodatabase
Geoprocessing
Locators
ESRI
ESRI Web
Web Services
Services
Clients
ArcGIS Desktop
Mobile
Web Applications
ArcGIS Explorer
SERUG 2008
ArcGIS Server
GIS Service types
Coorespond to items that can be published
5 available at 9.2
7 available at 9.3
ArcGIS Server: GIS Services
Each service type has one or more capabilities
Map Service
Map (always)
KML
WMS
WFS
WCS
Mobile Data Access
Network Analysis
Geodatabase
Geodata (always)
WFS
WCS
Geocode Service
Geoprocessing Service
Globe Service
Geometry Service
Image Service
ArcGIS Server: Web Enable GIS Capabilities
Use Server Manager or ArcCatalog
Check box enables web access
Provides URL
Demonstration
Publishling GIS Services for Web Access
SERUG 2008
What are ESRI GIS Services?
Out - of - Box
Mapping (2D & 3D)
Mobile
KML
Geodatabase
Geoprocessing
Locators
ESRI
ESRI Web
Web Services
Services
Clients
ArcGIS Desktop
Mobile
Web Applications
ArcGIS Explorer
SERUG 2008
ArcGIS Server - Web Services
ArcGIS Server GIS services
SOAP API
ArcObjects API
REST API and JavaScript API
How to get started?
What are SOAP Web Services?
Standard way of integrating Web based applications using XML,
SOAP, WSDL, and UDDI
Share business logic
Language neutral
Operating system neutral
UDDI
Enables
discovery of
Is accessed
using
Binds to
WSDL
SOAP
Enables
Communication
between
Describes
Web
Services
SERUG 2008
11
Review: What is UDDI?
Universal Description, Discovery and Integration
Registry
Businesses can publish service listing on the internet
Discovery of services
12
Review: What is XML?
Extensible Markup Language
Customized tags
Enables the
Definition
Transmission
Validation
Interpretation of data between applications and between
organizations.
13
Review: What is SOAP?
Used to stand for Simple Object Application Protocol
Application communication over the Internet
XML Messages over HTTP
Web Standard
Platform Independent
Language Independent
Simple and Extensible
Send messages between applications
14
Example SOAP Request
POST /item HTTP/1.1
Host: 189.123.345.239
Content-Type: text/plain
Content-Length: 200
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soapenvelope" soap:encodingStyle="http://www.w3.org/2001/12/soapencoding">
<soap:Body>
<m:GetPrice xmlns:m="http://www.server.com/prices">
<m:Item>Apples</m:Item>
</m:GetPrice>
</soap:Body>
</soap:Envelope>
Example SOAP Response
200 OK
Content-Type: text/plain
Content-Length: 200
<?xml version="1.0"?>
<soap:Envelope xmlns:soap="http://www.w3.org/2001/12/soapenvelope" soap:encodingStyle="http://www.w3.org/2001/12/soapencoding">
<soap:Body>
<m:GetPriceResponse xmlns:m="http://www.server.com/prices">
<m:Price>1.90</m:Price>
</m:GetPriceResponse>
</soap:Body>
</soap:Envelope>
Working with SOAP (outside the Web ADF)
Use a SOAP Toolkit (.NET or Java)
Proxy object (MapServer. GeocodeServer, etc.)
Methods and Properties
Value objects (supporting objects)
Properties
Review: What is WSDL?
Web Services Description Language
XML-based language
Describes what functions are available
Obtaining the WSDL for a service
http://www.xyz.com/service_endpoint?wsdl
SOAP Toolkit
18
Accessing ArcGIS Services via SOAP
No license required to use GIS Services
No ESRI software required
Accessing Services via SOAP
Each capability has a URL which can be referenced
http://www.w.org/arcgis/services/NorthAmerica/MapServer?wsdl
Demonstration
Accessing GIS Services via SOAP
SERUG 2008
21
ArcGIS Server - Web Services
ArcGIS Server GIS services
SOAP API
ArcObjects API
REST API and JavaScript API
How to get started?
What is the ArcObjects API?
Very large API that Supports:
ArcGIS Desktop applications
ArcGIS Engine applications
SOAP and REST ArcGIS Server APIs
Use course grained ArcObjects
Reasons to use ArcObjects API
Access greater functionality
Editing
Geometric Network Traces
Return x,y for Route Name and Measure
Functions not available in course grained objects and not
available via Geoprocessing
Leverage existing code
How to Utilize ArcObjects API
Accessible via ArcGIS Server SOAP API
Via Local Connection Only
Wrap code in a web service to give access to users and
applications over the web
Getting to ArcObjects from Server
Dim GISServerCon As IGISServerConnection = New
GISServerConnectionClass()
GISServerCon.Connect(machineName)
Dim som As IServerObjectManager =
GISServerCon.ServerObjectManager
Dim soc As IServerContext =
som.CreateServerContext(mapService, "MapServer")
Dim mapServer As IMapServer = soc.ServerObject
Dim mapServerObjects As IMapServerObjects2 = mapServer
Dim map As IMap = mapServerObjects.Map(dataFrame)
Demonstration
Accessing a Custom Web Service
SERUG 2008
27
ArcGIS Server - Web Services
ArcGIS Server GIS services
SOAP API
ArcObjects API
REST API and JavaScript API
How to get started?
Consuming Web Services with New 9.3 API
Front ends
JS APIs
Mobile
Applications
Web
Service
Interfaces
Back end
GIS Server
Google
Earth
Composite
Applications
WCS
KML
Browser Applications
WFS-T
REST
SOAP
Web Tier
WMS
ArcGIS
Explorer
ArcGIS
Desktop
Web Controls
Map Caching
Workflows
2D Mapping
3D Globe
Geodatabase
Locator
Geoprocessing
Image
What is REST?
Representational State Transfer
Simple Interface
Requests to the REST API are through HTTP GETS
Hierarchy of Resources
Browser is the new command line
ArcGIS Server provides a REST API at 9.3
http://server/arcgis/rest/services
ArcGIS Server REST API
Example URL:
http://localhost/ArcGIS/rest/services/MyStreets/GeocodeServer/
findAddressCandidates?Street=1058+Citrus+Av&f=html
Returns:
Shape:
X: 872241
Y: 1131422
Score: 100
Match_addr: 1058 CITRUS AVE
ArcGIS Server 9.3 REST API
Resources and operations results can be returned as:
HTML (Services Explorer-default)
IMAGE (direct streamed image)
KML (Google Earth, Google Maps, Virtual Earth)
JSON (developer)
JavaScript Object Notation
32
ArcGIS Server REST API
Resources and Operations:
Map Service
Export, Find, Identify
Map Service Layers
Query
Geocode Service
FindAddressCandidates, Reverse Geocode
Geoprocessing
Execute, Submit Job
ArcGIS Server 9.3 - Developer Experience:
New Services
Geometry Service
Project, Simplify, Buffer, Length And Area, Relation
Image Services
Export
Map example
Base Map URL:
http://atlanta.esri.com/ArcGIS/rest/services/chatham_county/MapServer
Export operation
baseUrl/export?bbox=855242,611406,1095348,838633
Exports Maps based on query
parameters specific to the URL
Demonstrations
1. Using REST API to access GIS Services
2. Building a Simple JavaScript Web Site
3. An Example Site
SERUG 2008
36
ArcGIS Server - Web Services
ArcGIS Server GIS services
SOAP API
ArcObjects API
REST API and JavaScript API
How to get started?
Choose the API for your requirements
ESRI ArcGIS Server Training
Introduction to ArcGIS Server (2 days)
Developing Applications Using ArcGIS Server for .NET (3 days)
Developing Applications Using ArcGIS Server for Java (3 days)
ArcGIS Server: Web Administration Using .NET (2 days) new
Help resources
ESRI Developer Network http://edndoc.esri.com
Direct link to SOAP API help
http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ArcGIS
/SOAP/overview.htm
Direct link to ArcObjects API help
http://edndoc.esri.com/arcobjects/9.2/NET_Server_Doc/developer/ArcGIS
/ArcObjects/server_apis.htm
Soon as easier navigation to all help documentation at 9.3.
http://resources.esri.com
Help Resources continued
Sample 9.3 Severs
http://sampleserver1.arcgisonline.com/ArcGIS/rest/services
http://sampleserver2.arcgisonline.com/ArcGIS/rest/services
9.3 Help (beta)
http://resources.esri.com
ArcGIS Server Developer Blog
http://blogs.esri.com/Dev/blogs/arcgisserver/default.aspx
ArcGIS Server - Web Services
Questions?