ArcGIS Server Web services
Web services Application Web services Web Catalog ArcGIS Server Web services 6-2
Web services? Internet (SOAP) :, : Credit card authentication, shopping carts GIS:, locator services, address matching, etc. 6-3
Web services? ArcMap Require credit card or authentication you want to manage Integrate applications Web service (.NET, Java).NET 6-4
Web services: The WSDL WSDL (Web Service ) WSDL XML Method calls and parameter types used Example: http://localhost/webcatalog/redlandsmap.aspx?wsdl Universal Description Discovery Integration (UDDI) WSDL directory source Lists all registered and publicly available services http://www.uddi.org/find.html: Select a node and search 6-5
WSDL http://locahost/webcatalog/redlandsmap.aspx?wsdl <?xml version"1.0" encoding"utf-8"?> <?xml version"1.0" encoding"utf-8"?> <definitions xmlns:soap"http://schemas.xmlsoap.org/wsdl/soap/" <definitions xmlns:soap"http://schemas.xmlsoap.org/wsdl/soap/" xmlns:xs"http://www.w3.org/2001/xmlschema" xmlns:xs"http://www.w3.org/2001/xmlschema" targetnamespace"http://www.esri.com/schemas/arcgis/9.0" targetnamespace"http://www.esri.com/schemas/arcgis/9.0" xmlns:e"http://www.esri.com/schemas/arcgis/9.0" xmlns"http://schemas.xmlsoap.org/wsdl/"> xmlns:e"http://www.esri.com/schemas/arcgis/9.0" xmlns"http://schemas.xmlsoap.org/wsdl/"> <types> <types> <xs:schema targetnamespace"http://www.esri.com/schemas/arcgis/9.0" <xs:schema targetnamespace"http://www.esri.com/schemas/arcgis/9.0" xmlns"http://www.esri.com/schemas/arcgis/9.0"> xmlns"http://www.esri.com/schemas/arcgis/9.0"> <xs:element name"getdocumentinfo"> <xs:element name"getdocumentinfo"> <xs:complextype /> <xs:complextype /> </xs:element> </xs:element> <xs:element name"getdocumentinforesponse"> <xs:element name"getdocumentinforesponse"> <xs:complextype> <xs:complextype> <xs:sequence> <xs:sequence> <xs:element name"result" type"propertyset" /> <xs:element name"result" type"propertyset" /> </xs:sequence> </xs:sequence> </xs:complextype> </xs:complextype> </xs:element> </xs:element> <xs:element name"getmapcount"> <xs:element name"getmapcount"> 6-6
Web services? SOAP HTTP XML Internet Web service client HTTP request HTTP response Web service 6-7
Web services ArcGIS Server? ADF SOAP Web services ADF GIS Server SOAP Web service public function myfcn (string) as string 6-8
ArcGIS Server Web services Web service ADF server objects SOAP API Server object SOAP API Web catalog ArcObjects server context ArcObjects (SOM,SOC) ArcObjects 6-9
ArcGIS Server Web services 1. ASP.NET Web service 2. ESRI assemblies 3. Web service 4. Web service 6-10
1. ASP.NET Web service ArcGIS Server.NET ADF 6-11
2. ESRI assemblies assemblies Project > Add Reference ESRI.ArcGIS.Server ESRI.ArcGIS.Server.WebControls (Connection class) Add imports statements 6-12
3. Web service HTTP SOAP [WebMethod] ArcObjects Web service must impersonate a member of the ArcGIS Server users group <WebMethod()> _ <WebMethod()> _ Public Function LocateAddress(ByVal Address String) String Public Function LocateAddress(ByVal Address String) String End Function End Function 6-13
Web <WebMethod()> <WebMethod()> Public Public Function Function LocateAddress(ByVal LocateAddress(ByVal Address Address String) String) String String serverconnection ServerConnection serverconnection ServerConnection SOM IServerObjectManager SOM IServerObjectManager servercontext servercontext IServerContext IServerContext geocodeserver IGeocodeServer geocodeserver IGeocodeServer Try Try 'Connect 'Connect to to the the GIS GIS Server Server serverconnection serverconnection ServerConnection("Sparticle") ServerConnection("Sparticle") serverconnection.connect() serverconnection.connect() 'Get 'Get Server Server Context Context SOM SOM serverconnection.serverobjectmanager serverconnection.serverobjectmanager servercontext servercontext SOM.CreateServerContext("RedlandsGeocode", SOM.CreateServerContext("RedlandsGeocode", "GeocodeServer") "GeocodeServer") 'Geocode 'Geocode the the address address geocodeserver geocodeserver servercontext.serverobject servercontext.serverobject propset propset IPropertySet IPropertySet servercontext.createobject("esrisystem.propertyset") servercontext.createobject("esrisystem.propertyset") propset.setproperty("street", propset.setproperty("street", Address) Address) results results IPropertySet IPropertySet results results servercontext.createobject("esrisystem.propertyset") servercontext.createobject("esrisystem.propertyset") results results geocodeserver.geocodeaddress(propset, geocodeserver.geocodeaddress(propset, Nothing) Nothing) point point IPoint IPoint results.getproperty("shape") results.getproperty("shape") Return Return point.x point.x & & " " " " & & point.y point.y Catch Catch Finally Finally servercontext.releasecontext() servercontext.releasecontext() End End Try Try End End Function Function 6-14
Impersonation agsusers Web.config <identity <identity impersonate true impersonate true username Joe username Joe password mypass /> password mypass /> ESRI.ArcGIS.Server.WebControls Impersonation class Identity class (domain, username, password) 'Setup 'Setup impersonation impersonation impersonate impersonate Impersonation Impersonation Impersonation Impersonation id id Identity Identity Identity Identity id.username id.username "Joe" "Joe" id.password id.password "mypass" "mypass" id.domain id.domain "avworld" "avworld" impersonate.identityobject(id) impersonate.identityobject(id) impersonate.impersonate() impersonate.impersonate() 6-15
4. Web service Visual Studio F5 Web service web Web 6-16
Web services SOAP Web Windows Web service 6-17
: WSDL 1. 2. WSDL http://sparticle/demoservice/service1.asmx?wsdl Add directive to reference Web service namespace 3. Web service getpoint getpoint GeocodeAddress GeocodeAddress GeocodeAddress GeocodeAddress results results String String results results getpoint.locateaddress(txtaddress.text) getpoint.locateaddress(txtaddress.text) 'Extract 'Extract the the x x and and y y values values from from the the string string coordarray() coordarray() String String results.split(" results.split(" ") ") x, x, y y String String x x coordarray(0) coordarray(0) y y coordarray(1) coordarray(1) point point IPoint IPoint Point Point point.putcoords(x, point.putcoords(x, y) y) Do Do something something with with point point MessageBox.Show(point.x MessageBox.Show(point.x & & " " " " & & point.y) point.y) 6-18
server objects Web services, server objects SOAP SOM SOAP server objects Web services Web catalog Web Catalog Web service server objects 6-19
Web service catalog.net ADF Web Service Catalog server localhost server objects Web catalog impersonation agsusers 6-20
ArcGIS Server Web services: Web Web Service Catalog Web services web service catalogs, SOAP Web service SOAP URLs Web Catalog http://localhost/redlandswebcatalog/default.aspx?wsdl Web service http://localhost/redlandswebcatalog/redlandsmap.aspx?wsdl http://localhost/redlandswebcatalog/redlandsgeocode.aspx?wsdl 6-21
server object Web catalog server object Map, Query, Data Geocode, reverse geocode Utility.vb web catalog server object [ServerObject Name].aspx.vb server object 6-22
ArcCatalog Web catalog URL All web.config Windows 6-23
Web catalog Web catalog GetServiceDescriptions: server objects 6-24
Mapserver Web service Mapserver object SOAP API 6-25
Geocode server Web service Geocode server object SOAP API 6-26
ArcGIS Web service : Web 1. 2. Web reference wsdl 3. Web services Export Export map map as as image image Use Use exercise exercise code code web web service service map map redlands.redlandsmap redlands.redlandsmap redlands.redlandsmap redlands.redlandsmap mapinfo mapinfo redlands.mapserverinfo redlands.mapserverinfo map.getserverinfo(map.getdefaultmapname) map.getserverinfo(map.getdefaultmapname) mapdesc mapdesc redlands.mapdescription redlands.mapdescription mapdesc mapdesc mapinfo.defaultmapdescription mapinfo.defaultmapdescription imagetype imagetype redlands.imagetype redlands.imagetype redlands.imagetype redlands.imagetype imagedisplay imagedisplay redlands.imagedisplay redlands.imagedisplay redlands.imagedisplay redlands.imagedisplay imagedesc imagedesc redlands.imagedescription redlands.imagedescription redlands.imagedescription redlands.imagedescription imagetype.imageformat imagetype.imageformat redlands.esriimageformat.esriimagejpg redlands.esriimageformat.esriimagejpg imagetype.imagereturntype imagetype.imagereturntype redlands.esriimagereturntype.esriimagereturnurl redlands.esriimagereturntype.esriimagereturnurl imagedisplay.imageheight imagedisplay.imageheight 400 400 imagedisplay.imagewidth imagedisplay.imagewidth 500 500 imagedisplay.imagedpi imagedisplay.imagedpi 150 150 imagedesc.imagedisplay imagedesc.imagedisplay imagedisplay imagedisplay imagedesc.imagetype imagedesc.imagetype imagetype imagetype mapimage mapimage redlands.mapimage redlands.mapimage mapimage mapimage map.exportmapimage(mapdesc, map.exportmapimage(mapdesc, imagedesc) imagedesc) 6-27
6 Web ADF WebCatalog ArcCatalog WebCatalog Web service ServiceLocations Web Web service WebCatalog 6-28
Web services? server objects Web service? Web service server objects? WebCatalog? WebCatalog server object? Web Catalog services? 6-29