Working with the ArcGIS Server ArcObjects API : ArcObjects API
Posted on 2007-09-14 13:52 Ekin.S.Sun 阅读(923) 评论(0) 编辑 收藏 举报Working with the ArcGIS Server ArcObjects API
Connecting to a GIS Server
To make use of ArcObjects via ArcGIS Server in your application, you must connect directly to the GIS server, which requires network access to the Server Object Manager (SOM).
ArcGIS Server Connection objects
You can connect to a GIS Server using the ArcGIS Server library (ESRI.ArcGIS.Server) or the ArcGIS Connection library (ESRI.ArcGIS.ADF.Connection ).
[C#] for ESRI.ArcGIS.Server
ESRI.ArcGIS.Server.GISServerConnectionClass gisconnection; gisconnection = new ESRI.ArcGIS.Server.GISServerConnectionClass(); gisconnection.Connect("localhost"); ESRI.ArcGIS.Server.IServerObjectManager som = gisconnection.ServerObjectManager;
[C#] for ESRI.ArcGIS.ADF.ConnectionESRI.ArcGIS.ADF.Identity identity = new ESRI.ArcGIS.ADF.Identity("user", "passwd", "domain"); ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection ags_connection; agsconnection = new ESRI.ArcGIS.ADF.Connection.AGS.AGSServerConnection("hostname", identity); agsconnection.Connect(); IServerObjectManager som = agsconnection.ServerObjectManager;Connecting to the GIS Server: SecurityIn addition to the Connect method, the IGISServerConnection interface has two properties:ServerObjectManager and ServerObjectAdmin. If the application is running as a user in theusers or administrators group, the application can access the ServerObjectManager property,which returns an IServerObjectManager interface. The IServerObjectManager interface providesmethods for accessing and creating objects within the server for use by applications.