ESRI Developer Summit 2008 ESRI Developer Summit 2008 1 1 Sud Menon Sud Menon Julio Andrade Julio Andrade Rex Hansen Rex Hansen Working with ArcGIS Server Web Services Working with ArcGIS Server Web Services Using the SOAP API Using the SOAP API
ESRI Developer Summit 2008ESRI Developer Summit 2008 11
Sud MenonSud MenonJulio AndradeJulio AndradeRex HansenRex Hansen
Working with ArcGIS Server Web Services Working with ArcGIS Server Web Services Using the SOAP APIUsing the SOAP API
Introductions
• Who are we?– Sud Menon– Julio Andrade– Rex Hansen
• Who are you?
• Please complete the session survey – we take your feedback seriously!
PleasePleasesilencesilencedevicesdevices
Developer Summit 2007Developer Summit 2007 33
AgendaAgenda
•• Brief overview of ArcGIS Server Web ServicesBrief overview of ArcGIS Server Web Services
•• 9.3 SOAP API Walkthrough :9.3 SOAP API Walkthrough :–– Functional capabilities of each GIS web serviceFunctional capabilities of each GIS web service–– The SOAP API for the serviceThe SOAP API for the service–– Sample applications that consume the serviceSample applications that consume the service
•• SOAP API : Under the Hood SOAP API : Under the Hood –– Implementation details of interest to youImplementation details of interest to you
Developer Summit 2007Developer Summit 2007 44
ArcGIS Server Web Services ArcGIS Server Web Services -- Overview Overview
•• ArcGIS Server has a rich set of GIS Web ServicesArcGIS Server has a rich set of GIS Web Services
•• You can work with Web Services using the following You can work with Web Services using the following apiapi’’ss / interfaces :/ interfaces :–– SOAPSOAP–– RESTREST–– OGCOGC
Developer Summit 2007Developer Summit 2007 55
ArcGIS Server ArcGIS Server –– Publishing GIS Web ServicesPublishing GIS Web Services
•• Author GIS resources (Author GIS resources (egeg maps, locators) using desktop.maps, locators) using desktop.
•• Publish GIS resources to create GIS Services.Publish GIS resources to create GIS Services.
•• A GIS Service may have multiple capabilities A GIS Service may have multiple capabilities –– EgEg Mapping, Network AnalysisMapping, Network Analysis
•• Each capability is exposed to consumers as an independent GIS Each capability is exposed to consumers as an independent GIS Web Service accessible over HTTP via SOAP or REST Web Service accessible over HTTP via SOAP or REST
Developer Summit 2007Developer Summit 2007 66
ArcGIS Server : SOAP Web Service URLsArcGIS Server : SOAP Web Service URLs
•• A standard scheme for all SOAP web service URLSA standard scheme for all SOAP web service URLS ::
•• http://<hostname>/<http://<hostname>/<arcgis_instancearcgis_instance>/services/<folder>/ >/services/<folder>/ <<servicenameservicename>/<>/<servicetypeservicetype>>
•• httphttp://://gis.mybiz.com/arcgis/services/usa/mapservergis.mybiz.com/arcgis/services/usa/mapserver
•• http://gis.mybiz.com/arcgis/services/northernca/SanFranchttp://gis.mybiz.com/arcgis/services/northernca/SanFranciscoLocator/geocodeserveriscoLocator/geocodeserver
•• To get the To get the wsdlwsdl ::•• http://http://gis.mybiz.com/arcgis/services/usa/mapserver?wsdlgis.mybiz.com/arcgis/services/usa/mapserver?wsdl
Developer Summit 2007Developer Summit 2007 77
ArcGIS Server SOAP Web Services ArcGIS Server SOAP Web Services --Out of the Box ClientsOut of the Box Clients
•• ArcGIS Explorer and ArcGIS Desktop are out of the ArcGIS Explorer and ArcGIS Desktop are out of the box Desktop Clientsbox Desktop Clients
•• You can use Manager wizards to build Web Mapping You can use Manager wizards to build Web Mapping Applications that consume GIS Web Services Applications that consume GIS Web Services –– no programming requiredno programming required
Developer Summit 2007Developer Summit 2007 88
Options for Developing Custom Client Applications that Options for Developing Custom Client Applications that use SOAP Web Servicesuse SOAP Web Services
•• Work with the Web ADF object model (for web apps) Work with the Web ADF object model (for web apps) –– Use the ArcGIS Server Internet data sourceUse the ArcGIS Server Internet data source
•• Work with ArcGIS Engine (for desktop apps)Work with ArcGIS Engine (for desktop apps)–– Use the ArcEngine object model and controlsUse the ArcEngine object model and controls–– Use Use MapServiceLayersMapServiceLayers, , WebLocatorsWebLocators and builtand built--in ArcObjects in ArcObjects
proxies for each web serviceproxies for each web service
•• Work directly with the SOAP APIWork directly with the SOAP API–– The focus of this presentationThe focus of this presentation–– You can use preYou can use pre--generated proxies that ship with the .Net and Java generated proxies that ship with the .Net and Java
Web Web ADFsADFs, , egeg ESRI.ArcGIS.ADF.ArcGISServerESRI.ArcGIS.ADF.ArcGISServer–– You can generate the proxies yourself using your You can generate the proxies yourself using your favouritefavourite wsdlwsdl
tooltool
Developer Summit 2007Developer Summit 2007 99
serviceservice
Working with a SOAP serviceWorking with a SOAP service
•• You work with Proxies and Value objects You work with Proxies and Value objects –– Generated from a WSDL using a SOAP toolkitGenerated from a WSDL using a SOAP toolkit
Value objectValue objectValue objectValue object
Value objectValue object Proxy objectProxy object
Client ApplicationClient Application ServerServer
WSDLWSDL
End Point End Point
SOAPSOAPToolkitToolkit Get WSDLGet WSDL
GenerateGenerate
Value objectValue objectValue objectValue object
Value objectValue object
Developer Summit 2007Developer Summit 2007 1010
SOAP Web Services SOAP Web Services -- AdvantagesAdvantages
• easily accessible from .Net, Java, C++
• well defined interface contract
• lets you take advantage of compile time type checking
• lends itself to standard OO programming
• fully integrated into IDE’s– Class documentation, Full intellisense
Developer Summit 2007Developer Summit 2007 1111
The ArcGIS Server SOAP APIThe ArcGIS Server SOAP API
•• Coarse GrainedCoarse Grained
•• StatelessStateless
•• Described by a Described by a wsdlwsdl -- the calling contract for the servicethe calling contract for the service
•• Methods take Methods take serializableserializable Value objects (simple structures) as parametersValue objects (simple structures) as parameters
•• Value Objects are based on existing well known ArcObjects typesValue Objects are based on existing well known ArcObjects types–– EgEg Color, Symbol, Graphic Element, Geometries, Color, Symbol, Graphic Element, Geometries, DataElementsDataElements
•• SimpleSimple
•• PowerfulPowerful
Developer Summit 2007Developer Summit 2007 1212
SOAP Web Services in 9.3SOAP Web Services in 9.3
•• Service Catalog Service Service Catalog Service –– discover the services on this serverdiscover the services on this server
•• Map Service Map Service –– draw maps, query datadraw maps, query data
•• Geocoding Service Geocoding Service –– address to location, location to addressaddress to location, location to address
•• Geometry Service Geometry Service –– projection, densification, bufferingprojection, densification, buffering
•• Network Analysis Service Network Analysis Service –– routing and network problem solvingrouting and network problem solving
•• Image Service Image Service -- access to large image repositoriesaccess to large image repositories
•• Geoprocessing Service Geoprocessing Service –– synchronous and synchronous and asynchasynch spatial analysisspatial analysis
•• Geodata Service Geodata Service –– data discovery, query, extraction and replicationdata discovery, query, extraction and replication
•• Mobile Service (accessed using the Mobile ADF client)Mobile Service (accessed using the Mobile ADF client)•• Globe Service (accessed using the ArcEngine client)Globe Service (accessed using the ArcEngine client)
Developer Summit 2007Developer Summit 2007 1313
Discovering Services Discovering Services –– The Service Catalog Web ServiceThe Service Catalog Web Service
Every ArcGIS Server has a Service Catalog Web ServiceEvery ArcGIS Server has a Service Catalog Web Service ::
•• What Services do you have ?What Services do you have ?<xs:element name="GetServiceDescriptions">
<xs:complexType/></xs:element>
<xs:element name="GetServiceDescriptionsResponse"> <xs:complexType> <xs:sequence> <xs:element name="ServiceDescriptions"
type="ArrayOfServiceDescription"/> </xs:sequence> </xs:complexType></xs:element>
<xs:complexType name="ArrayOfServiceDescription"> <xs:sequence> <xs:element name="ServiceDescription"
type="ServiceDescription"maxOccurs="unbounded"/>
</xs:sequence></xs:complexType>
<xs:complexType name="ServiceDescription"> <xs:sequence> <xs:element name="Name" type="xs:string"/> <xs:element name="Type" type="xs:string"/> <xs:element name="Url" type="xs:string"/> </xs:sequence></xs:complexType>
Method
Response
Value Object
Value Object
WSDL
ServiceCatalogServiceCatalog
ServiceDescriptionServiceDescriptionName, Type, URLName, Type, URL
http://<web server hostname>/<http://<web server hostname>/<arcgisarcgis instance>/instance>/services?wsdlservices?wsdl
GetServiceDescriptionsGetServiceDescriptions
Developer Summit 2007Developer Summit 2007 1414
Map ServiceMap Service
•• Based on a Map Document (.Based on a Map Document (.mxdmxd) authored using ArcMap) authored using ArcMap
•• Can be used to Can be used to dynamically generate mapdynamically generate map images images in a variety in a variety of image formatsof image formats
•• Can be used to Can be used to overlay additional information overlay additional information on top of the on top of the mapmap–– GraphicsGraphics–– Selection IDs and buffer distancesSelection IDs and buffer distances
Developer Summit 2007Developer Summit 2007 1515
Map ServiceMap Service
•• Can be used to identify featuresCan be used to identify features
•• Can be used to query featuresCan be used to query features–– Results returned as Geodatabase record setsResults returned as Geodatabase record sets–– Easily marshaled by valueEasily marshaled by value–– Can be converted to ADO.NET datasetsCan be converted to ADO.NET datasets–– Can return Can return densifieddensified geometries (new at 9.3)geometries (new at 9.3)–– Can return geometries as KML (new at 9.3)Can return geometries as KML (new at 9.3)
Developer Summit 2007Developer Summit 2007 1616
Map ServiceMap Service
•• Maps can be preMaps can be pre--rendered and cached for performance rendered and cached for performance resulting in a tiled map service that has a fixed set of scalesresulting in a tiled map service that has a fixed set of scales
•• Methods to discover if Methods to discover if –– A map is a tiled fixed scale map A map is a tiled fixed scale map –– If the map tiles correspond to single fused images or if there aIf the map tiles correspond to single fused images or if there are re
separate tiles for each layerseparate tiles for each layer
•• Methods to get the tiling schemeMethods to get the tiling scheme•• Methods to fetch tilesMethods to fetch tiles•• Tiles can also be obtained directly via HTTP Get.Tiles can also be obtained directly via HTTP Get.
Developer Summit 2007Developer Summit 2007 1717
Working with the Map ServiceWorking with the Map Service
// Drawing the map - generating map images
MapImage mi = ms.ExportMapImage (mapDescription, imageDescription);
// Querying the map
Recordset rs = ms.QueryFeatureData(mapName, layerID, queryFilter);
FidSet fs = ms.QueryFeatureIDs(mapName, layerID, queryFilter);
MapServerFindResult[] results
= ms.Find(mapDescription, mapImageDisplay, searchString,
expression, searchFields, findOption, layerIDs);
// Drawing the map - generating map images
MapImage mi = ms.ExportMapImage (mapDescription, imageDescription);
// Querying the map
Recordset rs = ms.QueryFeatureData(mapName, layerID, queryFilter);
FidSet fs = ms.QueryFeatureIDs(mapName, layerID, queryFilter);
MapServerFindResult[] results
= ms.Find(mapDescription, mapImageDisplay, searchString,
expression, searchFields, findOption, layerIDs);
Developer Summit 2007Developer Summit 2007 1818
Map Service Object Model Map Service Object Model -- DrawingDrawing
MapServerMapServerMapServerInfoMapServerInfo MapLayerInfoMapLayerInfo
MapDescriptorMapDescriptor LayerDescriptorLayerDescriptor
ImageDescriptorImageDescriptor
ImageDisplayImageDisplay
ImageTypeImageType
Developer Summit 2007Developer Summit 2007 1919
Map Service Object Model Map Service Object Model –– Querying FeaturesQuerying Features
MapServerMapServerRecordsetRecordset RecordRecord
IdentifyResultsIdentifyResults IdentifyResultIdentifyResult
FindResultsFindResults FindResultFindResult
Developer Summit 2007Developer Summit 2007 2020
Map Service Object Model Map Service Object Model –– Adding Custom GraphicsAdding Custom Graphics
MapServerMapServer GraphicElementGraphicElement
PolygonElementPolygonElementLineElementLineElementMarkerElementMarkerElement
GeometryGeometry
SymbolSymbol
PointNPointN PolygonNPolygonNLineNLineN
SimpleMarkerSymbolSimpleMarkerSymbol SimpleLineSymbolSimpleLineSymbol SimpleFillSymbolSimpleFillSymbol
Developer Summit 2007Developer Summit 2007 2121
Map Server Map Server –– Key MethodsKey Methods
MapCountMapCount No of maps in the serviceNo of maps in the service
MapNameMapName Name of a map, by indexName of a map, by index
GetServerInfoGetServerInfo Retrieves Information about a specified mapRetrieves Information about a specified map
ExportMapImageExportMapImage Generates an image based on a specified map descriptionGenerates an image based on a specified map description
GetLegendInfoGetLegendInfo Returns legend information for specified layersReturns legend information for specified layers
IdentifyIdentify Returns a collection of Identify ResultsReturns a collection of Identify Results
FindFind Returns a collection of Find ResultsReturns a collection of Find Results
QueryFeatureDataQueryFeatureData Returns a Returns a recordsetrecordset of features based on a query filterof features based on a query filter
FromMapPointsFromMapPoints Converts from map to screen/image coordinatesConverts from map to screen/image coordinates
ToMapPointsToMapPoints Converts from screen/image to map coordinatesConverts from screen/image to map coordinates
Developer Summit 2007Developer Summit 2007 2222
MapDescriptionMapDescription value object :value object :
Properties used to control the drawing of the mapProperties used to control the drawing of the map
NameName The name of the mapThe name of the map
LayerDescriptionsLayerDescriptions A collection of layer descriptionsA collection of layer descriptions
CustomGraphicsCustomGraphics CustomGraphicsCustomGraphics to be drawn on the mapto be drawn on the map
SpatialReferenceSpatialReference The spatial reference in which to draw the mapThe spatial reference in which to draw the map
TransparentColorTransparentColor The color that is transparentThe color that is transparent
Developer Summit 2007Developer Summit 2007 2323
LayerDescriptionLayerDescription value object :value object :
Properties used to control the drawing of a layerProperties used to control the drawing of a layer
LayerIDLayerID The ID for the layerThe ID for the layer
DefinitionExpressionDefinitionExpression The definition expression for the layerThe definition expression for the layer
VisibleVisible Is the Layer VisibleIs the Layer Visible
ShowLabelsShowLabels Should labels be drawnShould labels be drawn
SelectionFeaturesSelectionFeatures Selected feature idsSelected feature ids
SelectionColorSelectionColor Color to be used for selected featuresColor to be used for selected features
Developer Summit 2007Developer Summit 2007 2424
Map Service demoMap Service demo
GeoDBGeoDB MXDMXD Map SvcMap SvcWebWeb
ServerServer clientclient
GIS ServerGIS Server
Developer Summit 2007Developer Summit 2007 2525
Cached Map ServicesCached Map Services
•• Tiles preTiles pre--rendered at rendered at fixed scales fixed scales
•• Rapid display of static Rapid display of static base mapsbase maps
•• Richer symbols and Richer symbols and more informationmore information
Developer Summit 2007Developer Summit 2007 2626
Map Service Object Model Map Service Object Model –– Tiled Map ServicesTiled Map Services
MapServerMapServer TileCacheInfoTileCacheInfoLODInfoLODInfo
SpatialReferenceSpatialReference
Developer Summit 2007Developer Summit 2007 2727
Map Service Map Service –– Methods for working with tiled map servicesMethods for working with tiled map services
IsFixedScaleMapIsFixedScaleMap Indicates that the map has a fixed set of LODsIndicates that the map has a fixed set of LODs
HasSingleFusedMapCacheHasSingleFusedMapCache Indicates that the map has a single cache that Indicates that the map has a single cache that prefuses all layers prefuses all layers
GetTileCacheInfoGetTileCacheInfo Gets the tiling scheme for the mapGets the tiling scheme for the map
GetMapTileGetMapTile Gets the specified tile for the map given tile Gets the specified tile for the map given tile levellevel, , rowrow and and columncolumn coordinatescoordinates
GetVirtualCacheDirectoryGetVirtualCacheDirectory Gets the virtual cache directory for the map, if Gets the virtual cache directory for the map, if presentpresent
Developer Summit 2007Developer Summit 2007 2828
Tile Cache Info Object :Tile Cache Info Object :
Properties that describe a tiling schemeProperties that describe a tiling scheme
LODInfosLODInfos The levels of detail in the cache The levels of detail in the cache
{id, scale, resolution}{id, scale, resolution}
OriginOrigin The origin for the tiling gridThe origin for the tiling grid
TileColsTileCols The number of columns in a tileThe number of columns in a tile
TileRowsTileRows The number of rows in a tileThe number of rows in a tile
DPIDPI Resolution in dots per inch Resolution in dots per inch
SpatialReferenceSpatialReference The spatial reference of the cacheThe spatial reference of the cache
tileWidth = tileCols * LODResolutiontileWidth = tileCols * LODResolution
tileColumn = floor ((x tileColumn = floor ((x –– xorig) / tileWidth)xorig) / tileWidth)
tileHeight = tileRows * LODResolutiontileHeight = tileRows * LODResolution
tileRow = floor ((y tileRow = floor ((y –– yorig) / tileHeigh)yorig) / tileHeigh)
Developer Summit 2007Developer Summit 2007 2929
Geometry ServiceGeometry Service
•• A computational service, not bound to any data on the A computational service, not bound to any data on the server. New at 9.3server. New at 9.3
•• An ArcGIS Server can host a Geometry ServiceAn ArcGIS Server can host a Geometry Service–– Number of instances (service threads) can be increased as Number of instances (service threads) can be increased as
neededneeded
•• Provides basic geometric operations for use by web Provides basic geometric operations for use by web service clientsservice clients
•• You can also support geometric clients by publishing You can also support geometric clients by publishing GP tools like buffer, project and intersectGP tools like buffer, project and intersect
Developer Summit 2007Developer Summit 2007 3030
Geometry Service Geometry Service –– Object ModelObject Model
GeometryServerGeometryServer GeometryArrayGeometryArray GeometryGeometry
SpatialReferenceSpatialReference
UnitUnit
TransformationTransformation
Developer Summit 2007Developer Summit 2007 3131
Geometry Service Geometry Service -- Key MethodsKey Methods
BufferBuffer Buffers each geometry in an array of geometries by Buffers each geometry in an array of geometries by distances specified in an array of distancesdistances specified in an array of distances
ProjectProject Projects an array of geometries from their current Projects an array of geometries from their current spatial reference to the specified spatial referencespatial reference to the specified spatial reference
SimplifySimplify Generates topologically correct geometryGenerates topologically correct geometry
DensifyDensify Converts non linear geometry to linear geometryConverts non linear geometry to linear geometry
RelationRelation Determines the pairs of geometries in the input that Determines the pairs of geometries in the input that participate in the specified topologic relationshipparticipate in the specified topologic relationship
Developer Summit 2007Developer Summit 2007 3232
Geocode ServiceGeocode Service
•• Integrated application using Map, Geocode and Integrated application using Map, Geocode and Geometry ServicesGeometry Services
Developer Summit 2007Developer Summit 2007 3333
DemoDemo
•• Based on a Locator stored in the file system or in a Based on a Locator stored in the file system or in a GeodatabaseGeodatabase
•• Methods to perform single address and batch Methods to perform single address and batch geocodinggeocoding
•• Methods to perform reverse geocodingMethods to perform reverse geocoding
•• Support for different address stylesSupport for different address styles
Developer Summit 2007Developer Summit 2007 3434
Network Analysis ServiceNetwork Analysis Service
•• Based on publishing a map containing network Based on publishing a map containing network analysis layersanalysis layers
•• A network analysis layer represents a specific analysis A network analysis layer represents a specific analysis (Routing, Service Area, Closest Facility) to be (Routing, Service Area, Closest Facility) to be performed against a specific network dataset (for eg. performed against a specific network dataset (for eg. LA Streets)LA Streets)
•• Methods to :Methods to :–– Discover the parameters of the analysis solverDiscover the parameters of the analysis solver–– SolveSolve–– Get Results (paths, directions etc)Get Results (paths, directions etc)
•• Callers supply input parameters (for eg stops, barriers) Callers supply input parameters (for eg stops, barriers) using basic web service types such as PropertySets using basic web service types such as PropertySets and RecordSets.and RecordSets.
Developer Summit 2007Developer Summit 2007 3535
Network Analysis Service Network Analysis Service –– Object ModelObject Model
NAServerNAServerSolverParamsSolverParams SolverResultsSolverResults
ServiceAreaParamsServiceAreaParamsClosestFacilityParamsClosestFacilityParams
RouteParamsRouteParams
ServiceAreaResultsServiceAreaResultsClosestFacilityResultsClosestFacilityResults
RouteResultsRouteResults
NAServerLocationsNAServerLocations
NAServerPropertySetsNAServerPropertySets
Developer Summit 2007Developer Summit 2007 3636
NetworkAnalysis Server NetworkAnalysis Server –– Key MethodsKey Methods
•• Finding a Route :Finding a Route :–– Get Route Network Analysis LayerGet Route Network Analysis Layer–– Get Default Route Solver ParametersGet Default Route Solver Parameters–– Specify Desired Route Solver ParametersSpecify Desired Route Solver Parameters
•• Barriers, Stops, FindBestSequence, UseTimeWindows, Barriers, Stops, FindBestSequence, UseTimeWindows, ……–– SolveSolve–– Consume ResultsConsume Results
GetNALayerNamesGetNALayerNames Array of Network Analysis Layers of a particular Array of Network Analysis Layers of a particular typetype
GetNetworkDescriptionGetNetworkDescription Returns the Network Dataset Data Element for the Returns the Network Dataset Data Element for the specified layerspecified layer
GetSolverParametersGetSolverParameters Default Solver Parameters for the specified Network Default Solver Parameters for the specified Network Analysis LayerAnalysis Layer
SolveSolve Perform Network Analysis based on the specified Perform Network Analysis based on the specified solver parameterssolver parameters
Developer Summit 2007Developer Summit 2007 3737
Geocoding and Network Analysis Service demo Geocoding and Network Analysis Service demo -- routingrouting
NANA
MXDMXD MapSMapS
WebWebServerServer WebAppWebApp
NDND
LocatorLocator GeocodeSGeocodeS
GIS ServerGIS Server
Developer Summit 2007Developer Summit 2007 3838
Image ServiceImage Service•• New at 9.3New at 9.3•• Allows you to serve imagery and raster data :Allows you to serve imagery and raster data :
–– Raster Datasets Raster Datasets •• eg large mosaics in SDEeg large mosaics in SDE
–– Raster LayersRaster Layers•• With rendering set up on the serverWith rendering set up on the server
–– Image Service Definitions Image Service Definitions •• Catalogs of file based imagery that can be mosaiced and processeCatalogs of file based imagery that can be mosaiced and processed on d on
the flythe fly•• Uses a back end ArcGIS Image ServerUses a back end ArcGIS Image Server
•• Clients can controlClients can control–– Returned image format, mime or urlReturned image format, mime or url–– band selection, compression, projection, interpolationband selection, compression, projection, interpolation
Developer Summit 2007Developer Summit 2007 3939
Image Service Image Service –– Object ModelObject Model
ImageServerImageServer
ImageServiceInfoImageServiceInfo
GeoImageGeoImage
DescriptionDescription
ImageTypeImageType
ImageResultImageResult
Developer Summit 2007Developer Summit 2007 4040
Image Server Image Server -- Key MethodsKey Methods
ExportImageExportImage Returns the requested image using a well known image Returns the requested image using a well known image formatformat
GetImageGetImage Returns the requested image as a byte streamReturns the requested image as a byte stream
GetServiceInfoGetServiceInfo Returns the properties of the image serviceReturns the properties of the image service
-- numBands, pixelType, statistics etcnumBands, pixelType, statistics etc
Developer Summit 2007Developer Summit 2007 4141
Image Service demo Image Service demo -- routingrouting
RDSRDS ImageSvcImageSvcWebWeb
ServerServer WebAppWebApp
GIS ServerGIS Server
Developer Summit 2007Developer Summit 2007 4242
ArcGIS Server 9.3 ArcGIS Server 9.3 -- Geoprocessing ServiceGeoprocessing Service
•• Allows organizations to centralize both data and Allows organizations to centralize both data and processing on the serverprocessing on the server
•• Allows organizations with spatial data to expose spatial Allows organizations with spatial data to expose spatial analysis functionality against that data as easy to use analysis functionality against that data as easy to use tasks that can be invoked by less experienced userstasks that can be invoked by less experienced users
•• Allows GIS Analysts to easily author and publish Allows GIS Analysts to easily author and publish geoprocessing modelsgeoprocessing models
Developer Summit 2007Developer Summit 2007 4343
ArcGIS Server 9.3 ArcGIS Server 9.3 -- Geoprocessing ServiceGeoprocessing Service
•• You publish either a geoprocessing Toolbox or a Map You publish either a geoprocessing Toolbox or a Map containing Tool Layerscontaining Tool Layers
•• The service makes the tools available to the consumerThe service makes the tools available to the consumer
•• A GP Service may be associated with a map service that A GP Service may be associated with a map service that can be used to render results created on the server.can be used to render results created on the server.
•• Clients can also fetch vector and raster results by value.Clients can also fetch vector and raster results by value.
Developer Summit 2007Developer Summit 2007 4444
Geoprocessing Service Geoprocessing Service –– 9.3 Enhancements9.3 Enhancements
Improved PerformanceImproved Performance–– Reduced framework overhead for fast synchronous servicesReduced framework overhead for fast synchronous services–– Optimized transfer of large recordsets to and from serverOptimized transfer of large recordsets to and from server–– Tools have improved performance against SDETools have improved performance against SDE–– Faster execution of Python Script ToolsFaster execution of Python Script Tools
Improved LoggingImproved LoggingMore output formats (KML)More output formats (KML)Improved PublishingImproved Publishing
–– Better error reportingBetter error reporting–– Better detection of models that do not confirm to server Better detection of models that do not confirm to server
publishing rules (incompatible types)publishing rules (incompatible types)
Improved documentation Improved documentation –– Included with both Server and DesktopIncluded with both Server and Desktop
Developer Summit 2007Developer Summit 2007 4545
Geoprocessing Service Geoprocessing Service –– Object ModelObject Model
GPServerGPServerGPToolInfoGPToolInfo GPParameterInfoGPParameterInfo
GPResultOptionsGPResultOptions GPResultGPResult
JobMessageJobMessage
Developer Summit 2007Developer Summit 2007 4646
Geoprocessing Service Geoprocessing Service -- ParametersParameters
•• Supported parameter typesSupported parameter types–– StringString–– LongLong–– DoubleDouble–– BooleanBoolean–– DateDate–– Linear unitLinear unit–– Feature SetFeature Set–– Record SetRecord Set–– RasterRaster
Developer Summit 2007Developer Summit 2007 4747
Geoprocessing Service PropertiesGeoprocessing Service Properties
•• Execution Mode :Execution Mode :
–– SynchronousSynchronous•• Results calculated and returned immediately by valueResults calculated and returned immediately by value•• Appropriate for fast tools with small resultsAppropriate for fast tools with small results
–– AsynchronousAsynchronous•• Allows client to submit a job and come back later to fetch or drAllows client to submit a job and come back later to fetch or draw aw
resultsresults•• Results are saved on the serverResults are saved on the server•• large results are best left on the serverlarge results are best left on the server
Developer Summit 2007Developer Summit 2007 4848
Geoprocessing Service Geoprocessing Service –– Key MethodsKey Methods
GetToolNamesGetToolNames Return the names of the tools in the service.
GetToolInfoGetToolInfo Returns the signature and default parameter values for a tool
GetExecutionTypeGetExecutionType Return the type of execution: synchronous or asynchronous.
ExecuteExecute Execute a synchronous geoprocessing tool.
SubmitJobSubmitJob Execute an asynchronous geoprocessing tool.
GetJobStatusGetJobStatus Return the current status of a geoprocessing job.
GetJobMessagesGetJobMessages Return verbose messages representing the current state of a submitted geoprocessing job.
GetJobResultsGetJobResults Return the results of a geoprocessing job that has completed successfully.
Developer Summit 2007Developer Summit 2007 4949
Geoprocessing Demo Geoprocessing Demo ––interrogate a service, use a clip tool in the serviceinterrogate a service, use a clip tool in the service
Map SvcMap Svc
GP SvcGP Svc
WebWebServerServer clientclientMXDMXDToolBoxToolBox
ClipClip
GIS ServerGIS Server
Developer Summit 2007Developer Summit 2007 5050
Geodata Services and ReplicationGeodata Services and Replication
•• Geodata Services allow you to publish a geodatabase Geodata Services allow you to publish a geodatabase so that it can be accessed remotely over the Webso that it can be accessed remotely over the Web
•• ArcGIS Desktop can be used as a client with both ArcGIS Desktop can be used as a client with both local and remote geodatabases in order tolocal and remote geodatabases in order to–– Extract data Extract data –– Create replicasCreate replicas–– Synchronize replicasSynchronize replicas
Developer Summit 2007Developer Summit 2007 5151
Working with Geodata Services in ArcGIS DesktopWorking with Geodata Services in ArcGIS Desktop
•• All the distributed database tools work with local All the distributed database tools work with local geodatabase connections as well as with geodata geodatabase connections as well as with geodata services (services (““ remote geodatabase connections remote geodatabase connections ““))
•• GIS Analysts can also use GP scripting to setup GIS Analysts can also use GP scripting to setup automated synchronization jobs that automatically automated synchronization jobs that automatically synchronize geodatabases at periodic intervalssynchronize geodatabases at periodic intervals
Developer Summit 2007Developer Summit 2007 5252
Geodata ServiceGeodata Service
•• Methods for Methods for
–– browsing datasetsbrowsing datasets
–– exporting datasets to XMLexporting datasets to XML
–– creating checkcreating check--out, 1 way and 2 way replicas that can be down out, 1 way and 2 way replicas that can be down loaded and editedloaded and edited
–– exporting and importing replica changes.exporting and importing replica changes.
Developer Summit 2007Developer Summit 2007 5353
Geodata Service Geodata Service –– Object ModelObject Model
GeodataServerGeodataServer
GPReplicaDescriptionGPReplicaDescription GPReplicaDatasetGPReplicaDataset
GDSExportOptionsGDSExportOptions GDSDataGDSData
Developer Summit 2007Developer Summit 2007 5454
Geodata Service demo Geodata Service demo –– data extractiondata extraction
GDBGDB GeodataSvcGeodataSvc
MXDMXD MapSvcMapSvc
WebWebServerServer clientclient
GIS ServerGIS Server
Developer Summit 2007Developer Summit 2007 5555
Geodata Service Geodata Service -- Creating a replicaCreating a replica
//create array of datasetsGPReplicaDataset[] repDSs = new GPReplicaDataset[2];
//fill it up w/datasets to replicateGPReplicaDataset repDS = new GPReplicaDataset();repDS.DatasetName = "Parcels";repDS.DatasetType = esriDatasetType.esriDTFeatureClass;//selection IDs, UseGeometry, DefQuery...repDSs[0] = repDS;
repDS = new GPReplicaDataset();repDS.DatasetName = "Buildings";repDS.DatasetType = esriDatasetType.esriDTFeatureClass;repDSs[1] = repDS;
//setup a replicaDescriptionGPReplicaDescription repDesc = new GPReplicaDescription();repDesc.GPReplicaDatasets = repDSs;repDesc.QueryGeometry = myEnvelope;repDesc.SingleGeneration = true; //ie checkOut …
//create array of datasetsGPReplicaDataset[] repDSs = new GPReplicaDataset[2];
//fill it up w/datasets to replicateGPReplicaDataset repDS = new GPReplicaDataset();repDS.DatasetName = "Parcels";repDS.DatasetType = esriDatasetType.esriDTFeatureClass;//selection IDs, UseGeometry, DefQuery...repDSs[0] = repDS;
repDS = new GPReplicaDataset();repDS.DatasetName = "Buildings";repDS.DatasetType = esriDatasetType.esriDTFeatureClass;repDSs[1] = repDS;
//setup a replicaDescriptionGPReplicaDescription repDesc = new GPReplicaDescription();repDesc.GPReplicaDatasets = repDSs;repDesc.QueryGeometry = myEnvelope;repDesc.SingleGeneration = true; //ie checkOut …
Developer Summit 2007Developer Summit 2007 5656
Geodata Service Geodata Service -- Creating a replicaCreating a replica
//extra optionsGPReplicaOptions repOpts = new GPReplicaOptions();repOpts.AccessType = esriReplicaAccessType.esriReplicaBothReadWrite;
//how to format the dataGDSExportOptions expOpts = new GDSExportOptions();expOpts.ExportFormat = esriGDSExportFormat.esriGDSExportFormatFileGDB;
//how to transfer the dataesriGDSTransportType transpType = esriGDSTransportType.esriGDSTransportTypeUrl;
//create the replicaGDSData data =
m_gds.CreateReplica(sdeVersion, repName, repDesc, repOpts, expOpts, transpType);
DownloadFile(data.URL, outFGdb);
//m_gds.ExtractData with similar signature will extract the data (no replica created)
//extra optionsGPReplicaOptions repOpts = new GPReplicaOptions();repOpts.AccessType = esriReplicaAccessType.esriReplicaBothReadWrite;
//how to format the dataGDSExportOptions expOpts = new GDSExportOptions();expOpts.ExportFormat = esriGDSExportFormat.esriGDSExportFormatFileGDB;
//how to transfer the dataesriGDSTransportType transpType = esriGDSTransportType.esriGDSTransportTypeUrl;
//create the replicaGDSData data =
m_gds.CreateReplica(sdeVersion, repName, repDesc, repOpts, expOpts, transpType);
DownloadFile(data.URL, outFGdb);
//m_gds.ExtractData with similar signature will extract the data (no replica created)
Developer Summit 2007Developer Summit 2007 5757
Geodata Service Geodata Service –– Synchronizing ReplicasSynchronizing Replicas
//export from source gdsGDSData changhes
= src_gds.ExportReplicaDataChanges(repName, expOpts, transpType, esriExportGenerationsOption.esriExportGenerationsAll, switchRoleYes);
//import into destination gdsdest_gds.ImportReplicaDataChanges(
esriGDSReplicaImportSource.esriGDSReplicaImportSourceDeltaFileGDB, esriReplicaRecPolicyType.esriResolveConflictsInFavorOfDatabaseChanges, colLevelYes, changes);
//repeat in the opposite direction
//export from source gdsGDSData changhes
= src_gds.ExportReplicaDataChanges(repName, expOpts, transpType, esriExportGenerationsOption.esriExportGenerationsAll, switchRoleYes);
//import into destination gdsdest_gds.ImportReplicaDataChanges(
esriGDSReplicaImportSource.esriGDSReplicaImportSourceDeltaFileGDB, esriReplicaRecPolicyType.esriResolveConflictsInFavorOfDatabaseChanges, colLevelYes, changes);
//repeat in the opposite direction
Developer Summit 2007Developer Summit 2007 5858
Developing Desktop and ArcEngine Clients to the Developing Desktop and ArcEngine Clients to the GeodataServiceGeodataService
•• Use the GeoDataServer and Use the GeoDataServer and ReplicationAgent proxy classes ReplicationAgent proxy classes that are part of the that are part of the GeodatabaseDistributed GeodatabaseDistributed ArcObjects assemblyArcObjects assembly
•• ReplicationAgent gives you ReplicationAgent gives you single call synchronizationsingle call synchronization
GeoDataServer1(proxy)
ReplicationAgent
GeoDataServer2(proxy)
Geodatabase
GeoDataServer2
Geodatabase
GeoDataServer1
Internet Internet
Developer Summit 2007Developer Summit 2007 5959
ArcGIS Server Web Services ArcGIS Server Web Services –– Under the HoodUnder the Hood
•• SOAP requests received by the web server are handled by a SOAP requests received by the web server are handled by a custom HTTP handler [.Net] / Servlet [Java] and forwarded to thecustom HTTP handler [.Net] / Servlet [Java] and forwarded to thecorresponding server object in the GIS Server for processing.corresponding server object in the GIS Server for processing.
•• ArcGIS includes its own SOAP stack and XML serialization ArcGIS includes its own SOAP stack and XML serialization framework for ArcObjectsframework for ArcObjects
•• All parameter objects implement IXMLSerializeAll parameter objects implement IXMLSerialize
•• SOAP requests [the SOAP body] is deserialized and processed SOAP requests [the SOAP body] is deserialized and processed by the server objectby the server object
•• Results are serialized into the corresponding SOAP responseResults are serialized into the corresponding SOAP response
Developer Summit 2007Developer Summit 2007 6060
ArcGIS Server ArcGIS Server
Web ApplicationsWeb Applications
GIS Services GIS Services -- Web Service EndpointsWeb Service Endpoints
GIS Services GIS Services -- Server ObjectsServer Objects
GIS ServerGIS Server
WebWeb ServerServer
BrowserBrowserDesktopDesktop
HTTPHTTP
TCP/IPTCP/IP
MobileMobile
DHTMLDHTMLSOAP / BinarySOAP / Binary
BrowserBrowser
RESTREST
SOAPSOAP
SOAPSOAPSOAP / BinarySOAP / Binary
Developer Summit 2007Developer Summit 2007 6262
Working with SOAP requests over the LANWorking with SOAP requests over the LAN
•• Web ADF includes both a Web proxy as well as a LAN proxyWeb ADF includes both a Web proxy as well as a LAN proxy•• Web service proxy generated from WSDL Web service proxy generated from WSDL -- MapServerProxyMapServerProxy
–– Used for SOAP / HTTPUsed for SOAP / HTTP
•• LAN proxy is also included LAN proxy is also included -- MapServerDCOMProxyMapServerDCOMProxy–– Used for SOAP / LANUsed for SOAP / LAN–– Uses the IRequestHandler interface to submit SOAP requests direcUses the IRequestHandler interface to submit SOAP requests directly tly
to the server objectto the server object
Value objectValue objectValue objectValue object
Value objectValue object
SoapSoapWeb ServiceWeb Service
ProxyProxy
ArcGIS ServerArcGIS ServerClient ApplicationClient Application
SOM/SOCSOM/SOC
Web ServiceWeb Serviceend pointend point
Server objectServer object(end point)(end point)
SoapSoapLANLANProxyProxy
Web ServerWeb Server
objectobjectobjectobject
objectobject
IRequestHandlerIRequestHandler
Summary
• ArcGIS Server has a rich set of GIS Web Services
• You can work with services using the SOAP API
• The SOAP API is – easily accessible from .Net and Java– has a well described contract– is fully integrated into IDE’s– lets you take advantage of compile time type checking
In ConclusionIn Conclusion……
•• Other recommended sessions and meetingsOther recommended sessions and meetings–– Using the ArcGIS Server REST APIUsing the ArcGIS Server REST API
•• All sessions are recorded and will be available on EDNAll sessions are recorded and will be available on EDN–– Slides and code will also be availableSlides and code will also be available
•• Please fill out session surveys!Please fill out session surveys!
•• Still have questions?Still have questions?1.1.Tech talk, Demo Theatres, Meet the TeamTech talk, Demo Theatres, Meet the Team2.2.““Ask a DeveloperAsk a Developer”” link on web pagelink on web page
•• www.esri.com/devsummit/techquestionswww.esri.com/devsummit/techquestions
ESRI Developer Summit 2008ESRI Developer Summit 2008 6464