This document is archived and information here might be outdated.  Recommended version.


GISClient (ArcObjects .NET 10.5 SDK)

GISClient


Supported with:
  • Engine
  • ArcGIS for Desktop Basic
  • ArcGIS for Desktop Standard
  • ArcGIS for Desktop Advanced
  • Server
Library dependencies: Version, System, SystemUI, Geometry, GraphicsCore, Display, Server, Output, Geodatabase

Additional library information: Contents, Object Model Diagram

The GISClient library allows you to consume Web services. These Web services can be provided by ArcIMS and ArcGIS for Server. The library includes objects for connecting to geographic information system (GIS) servers to use Web services. There is support for ArcIMS Image and Feature services.
The library provides a common programming model for working with ArcGIS Server objects in a stateless manner either directly or through a Web service catalog. The ArcObjects components running on the ArcGIS Server are not accessible through the GISClient library. To gain direct access to ArcObjects running on the server, use functionality in the Server library.

See the following sections for more information about this namespace:

ArcGIS Server Client

ArcGIS Desktop and ArcGIS Engine developers can consume ArcGIS Server Web services using the ArcGIS Server Client application programming interface (API) (AGSClient), which is in the GISClient object library. AGSClient includes objects and methods for connecting to GIS servers either directly or through Web service catalogs to use the MapServer and GeocodeServer objects. GISClient differs from the Server library in that it restricts clients to calling only the coarse-grained methods on the server object and does not provide access to the finer-grained ArcObjects associated with a server object.
AGSServerConnection is a connection to a GIS server or Web service catalog. Both contain server objects such as MapServer and GeocodeServer. It provides methods to get references to server objects. If AGSServerConnection is a direct connection to the GIS server over a local area network (LAN), there are methods to get references to ServerObjectManager and ServerObjectAdmin for the GIS server.
The following diagram details the AGSServerConnection object:
AGSServerConnection provides an AGSServerConnectionName object as the value of its FullName property. The AGSServerConnectionName for an AGSServerConnection can be persisted, for example, in a map document. An application can call the Open method on the AGSServerConnection name after loading it from persistent storage to connect to and get an object reference to the GIS server or Web service catalog.
The MapServer and GeocodeServer objects that you obtain through AGSServerConnection support only the coarse-grained, stateless methods associated with the server object. You can't use a MapServer or GeocodeServer object obtained from AGSServerConnection to get references to the finer-grained objects associated with the server object, nor can you change any aspects of the server object's state. Server objects obtained from LAN connections or Web service catalog AGSServerConnections can be used in the same way, so if you are writing applications that need to work with both LAN and Web service catalog connections to a GIS server, use AGSServerConnection and its associated objects.
When you get a server object using the ArcCatalog (GxAGSServerConnection) and ArcMap (MapServerLayer) objects, you're working through AGSServerConnection. To work with a server object in a stateful manner, or to work with the finer-grained ArcObjects associated with a server object, you must obtain that server object by getting a reference to its server context from ServerObjectManager. You can get ServerObjectManager by either connecting to the GIS server using a GISServerConnection object in the Server library or by getting it from AGSServerConnection.
IAGSServerConnection provides methods to get references to server objects in the server or Web service catalog. The GetServerObjectNames method returns the AGSServerObjectName objects for all the server objects in the GIS server or Web service catalog.
AGSServerConnectionFactory is a dispenser of AGSServerConnection objects and allows a client to connect to an ArcGIS Server either directly over a LAN or indirectly to a specified Web service catalog. AGSServerConnectionFactory maintains a pool of currently connected, active connections that are referenced by the application. Connection properties are specified using a PropertySet object and can be saved to a connection file.
The IAGSServerConnectionFactory interface provides methods for creating AGSServerConnections based on property sets or connection files. Use the Open method to create an AGSServerConnection based on a property set. The properties required in the property set depend on whether you are connecting directly to a GIS server over a LAN, or to a Web service catalog. When connecting to a GIS server over a LAN, you need to set the machine property to the name of the GIS server machine. When connecting to a Web service catalog, you need to set the URL property to the uniform resource locator (URL) of the Web service catalog.
If the Web service catalog to which you are connecting is secure and requires a username and password, include them in the property set as the User and Password properties, respectively.
The following code shows how to use AGSServerConnectionFactory to create AGSServerConnection to a Web service catalog and list the set of server objects and their type that are exposed as Web services in the Web service catalog:
[VB.NET]
Dim AGSConnectionFactory As IAGSServerConnectionFactory=New AGSServerConnectionFactory
Dim connectionProps As IPropertySet=New PropertySet
connectionProps.SetProperty("URL", "http://myURL/myCatalog/default.aspx")

Dim AGSConnection As IAGSServerConnection=AGSConnectionFactory.Open(connectionProps, 0)
Dim enumSOName As IAGSEnumServerObjectName
enumSOName=AGSConnection.ServerObjectNames
Dim SOName As IAGSServerObjectName
SOName=enumSOName.Next

Do Until SOName Is Nothing
    Debug.Print(SOName.Name & ": " & SOName.Type)
    SOName=enumSOName.Next
Loop
[C#]
IAGSServerConnectionFactory AGSConnectionFactory=new AGSServerConnectionFactory();
IPropertySet connectionProps=new PropertySet();
connectionProps.SetProperty("URL", "http://myURL/myCatalog/default.aspx");

IAGSServerConnection AGSConnection=AGSConnectionFactory.Open(connectionProps, 0);
IAGSEnumServerObjectName enumSOName=null;
enumSOName=AGSConnection.ServerObjectNames;
IAGSServerObjectName SOName=null;
SOName=enumSOName.Next();

while (SOName != null)
{
    Debug.Print(SOName.Name + ": " + SOName.Type);
    SOName=enumSOName.Next();
}
The following code shows how to use AGSServerConnectionFactory to create a direct AGSServerConnection to a GIS server directly running on the machine "melange" and list the set of server objects and their type that are running in the GIS server:
[VB.NET]
Dim AGSConnectionFactory As IAGSServerConnectionFactory=New AGSServerConnectionFactory
Dim AGSConnection As IAGSServerConnection
Dim connectionProps As IPropertySet=New PropertySet
connectionProps.SetProperty("machine", "melange")

AGSConnection=AGSConnectionFactory.Open(connectionProps, 0)

Dim enumSOName As IAGSEnumServerObjectName
enumSOName=AGSConnection.ServerObjectNames

Dim pSOName As IAGSServerObjectName
pSOName=enumSOName.Next

Do Until pSOName Is Nothing
    Debug.Print(pSOName.Name & ": " & pSOName.Type)
    pSOName=enumSOName.Next
Loop
[C#]
IAGSServerConnectionFactory AGSConnectionFactory=new AGSServerConnectionFactory();
IAGSServerConnection AGSConnection=null;
IPropertySet connectionProps=new PropertySet();
connectionProps.SetProperty("machine", "melange");

AGSConnection=AGSConnectionFactory.Open(connectionProps, 0);
IAGSEnumServerObjectName enumSOName=null;
enumSOName=AGSConnection.ServerObjectNames;

IAGSServerObjectName pSOName=null;
pSOName=enumSOName.Next();

while (pSOName != null)
{
    Debug.Print(pSOName.Name + ": " + pSOName.Type);
    pSOName=enumSOName.Next();
}
You can get a reference to ServerObjectManager through the AGSClient connection, provided that connection is a LAN connection. You can then use the methods exposed by ServerObjectManager to obtain references to server contexts and server objects to work with the Server API.
The IAGSServerConnectionAdmin interface provides a bridge between the GISClient objects and the Server object library. IAGSServerConnection is supported only on AGSServerConnection objects that are connections made directly to servers over a LAN. A cast to IAGSServerConnection will fail on AGSServerConnections that are connections to Web service catalogs.
If the application using this interface is running as a user in the GIS server's users group (agsusers), it can use the ServerObjectManager property to get a reference to the GIS server's ServerObjectManager. Using the ServerObjectManager, you can create server contexts, work with ArcObjects in the GIS server, and so on.
If the application using this interface is running as a user in the GIS server's administrators group (agsadmin), it can use the ServerObjectAdmin property to get a reference to the GIS server's ServerObjectAdmin. Using ServerObjectAdmin, you can perform administration tasks such as starting and stopping server objects.
The ServerObjectConfiguration property returns ServerObjectConfiguration for the specified server object and type. The application must be running as a member of the GIS server's administrators group (agsadmin) to successfully get this property.
The IAGSServerObjectName interface lets you access the properties of AGSServerObjectName, which is the name object for a MapServer or GeocodeServer object obtained through AGSServerConnection. IAGSServerObjectName has properties for the server object's name, type, and if connecting to a Web service catalog, URL.
The following code shows how to create AGSServerObjectName and open it to get a MapServer object through an AGSServerConnection LAN connection:
[VB.NET]
Dim AGSServerConnectionName As IAGSServerConnectionName=New AGSServerConnectionName
Dim props As IPropertySet=New PropertySet
props.SetProperty("machine", "doug")
AGSServerConnectionName.ConnectionProperties=props

Dim AGSServerObjectName As IAGSServerObjectName=New AGSServerObjectName
AGSServerObjectName.Name="GDBRaster"
AGSServerObjectName.Type="MapServer"
AGSServerObjectName.AGSServerConnectionName=AGSServerConnectionName

Dim Name As IName
Name=TryCast(AGSServerObjectName, IName)
Dim mapServer As IMapServer2
mapServer=TryCast(Name.Open, IMapServer2)
[C#]
IAGSServerConnectionName AGSServerConnectionName=new AGSServerConnectionName();
IPropertySet props=new PropertySet();
props.SetProperty("machine", "doug");
AGSServerConnectionName.ConnectionProperties=props;

IAGSServerObjectName AGSServerObjectName=new AGSServerObjectName();
AGSServerObjectName.Name="GDBRaster";
AGSServerObjectName.Type="MapServer";
AGSServerObjectName.AGSServerConnectionName=AGSServerConnectionName;

IName name=null;
name=AGSServerObjectName as IName;
IMapServer2 mapServer=null;
mapServer=name.Open()as IMapServer2;

ArcIMS Client

ArcGIS Desktop and ArcGIS Engine developers can consume ArcIMS Server Web services using AGSClient. In addition, AGSClient includes objects and methods for connecting to ArcIMS servers and services.
IIMSServiceDescription provides access to ArcIMS connection properties such as information on the security of the service, the type of ArcIMS service, the name of the service, and its URL. ArcIMS communicates with its clients in ArcXML. The IIMSAxlRequest interface provides methods to send ArcXML requests to the ArcIMS server. These methods include SendAxlRequest, SendAxlRequestStream, and SendCommandRequest.
ArcIMS provides two types of map services: Image and Feature. An ArcIMS Image Service is a raster representation of a map. When you add an ArcIMS Image Service to a map, a new layer is added to the map. This layer is an Internet Map Server (IMS) map layer, IMSMapLayer. IMSMapLayer is a composite layer consisting of an IMS sublayer.
An ArcIMS Feature Service is similar to a feature dataset that contains many feature classes. Each ArcIMS feature class represents a unique entity; the actual features are streamed to the client. When you add a feature service to a map, a group layer consisting of one or more feature layers is also added to the map. You can work with feature layers based on ArcIMS Feature Services the same way you work with feature layers based on local feature classes.
The IIMSFeatureClass interface provides properties that control the ArcIMS Feature class. These include LayerID, MapUnits, and Axl. Additional interfaces include IIMSUserRole and IIMSWorkspace.