GISClient


Supported with:
Library dependencies: System, SystemUI, Geometry, Display, Server, Output, Geodatabase

Additional library information: Contents, Object Model Diagram

The GISClient library allows developers to consume Web Services. These Web services can be provided by ArcIMS and ArcGIS for Server. The library includes objects for connecting to GIS servers to make use of 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 interface. To gain direct access to ArcObjects running on the server, you should use functionality in the Server library.

See the following sections for more information about this namespace:

ArcGIS Server client

ArcGIS for Desktop and ArcGIS Engine developers can consume ArcGIS Server Web services using the ArcGIS Server Client (AGSClient) application programming interface (API), which is in the GISClient object library. AGSClient includes objects and methods for connecting to geographic information system (GIS) servers directly or through Web service catalogs to make use of MapServer and GeocodeServer objects. AGSClient 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. See the following illustration:

AGSServerConnection

An AGSServerConnection is a connection to a GIS server or Web service catalog. Both contain server objects such as MapServer and GeocodeServer server objects and provides methods to get references to server objects. If the AGSServerConnection is a direct connection to the GIS server over a local area network (LAN), there are methods to get references to the ServerObjectManager and ServerObjectAdmin for the GIS server. See the following illustration:
An AGSServerConnection hands out 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 obtained through an AGSServerConnection support only the coarse grained, stateless methods associated with the server object. You can't use a MapServer or GeocodeServer object obtained from an 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 objects (GxAGSServerConnection) and ArcMap (MapServerLayer), you are working through an AGSServerConnection.
To work with a server object in a stateful manner, or to work with the finer grained ArcObjects associated with a server object, obtain that server object by getting a reference to its server context from the ServerObjectManager. You can get the ServerObjectManager by connecting to the GIS server using a ServerConnection object in the Server library or by getting it from the 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 of the server objects in the GIS server or Web service catalog.

AGSServerConnectionFactory

An AGSServerConnectionFactory is a dispenser of AGSServerConnection objects and allows a client to connect to an ArcGIS Server directly over a LAN or indirectly to a specified Web service catalog. An AGSServerConnectionFactory maintains a pool of currently connected, active connections that are being 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 propert set. The properties required in the property set depend on whether you are connecting directly to a GIS server over a LAN or if you are connecting to a Web service catalog. When connecting to a GIS server over the LAN, set the machine property to be the name of the GIS server machine. When connecting to a Web service catalog, set the uniform resource locator (URL) property to the URL of the Web service catalog. See the following illustration:
If the Web service catalog you are connecting to is secure and requires a user name and password, include them in the property set as the user and password properties, respectively.
The following code example shows how to use the AGSServerConnectionFactory to create an AGSServerConnection to a Web service catalog and lists the set of server objects and types exposed as Web services in the Web service catalog:
[Java]
try{
    AGSServerConnectionFactory conFactory = new AGSServerConnectionFactory();
    PropertySet props = new PropertySet();

    props.setProperty("URL", "http://mercy:8080/SanFran/catalog");
    IAGSServerConnection connection = conFactory.open(props, 0);

    IAGSEnumServerObjectName enumSOName = connection.getServerObjectNames();

    IAGSServerObjectName name = enumSOName.next();

    while (name != null){
        System.out.println(name.getName() + " : " + name.getType());
        name = enumSOName.next();
    }

}

catch (Exception e){
    e.printStackTrace();
}
The following code example shows how to use AGSServerConnectionFactory to create a direct AGSServerConnection to a GIS server (directly running on the mercy machine) and lists the set of server objects and types that are running in the GIS server:
[Java]
try{
    AGSServerConnectionFactory conFactory = new AGSServerConnectionFactory();
    PropertySet props = new PropertySet();

    props.setProperty("machine", "mercy");
    IAGSServerConnection connection = conFactory.open(props, 0);
    IAGSEnumServerObjectName enumSOName = connection.getServerObjectNames();

    IAGSServerObjectName name = enumSOName.next();

    while (name != null){
        System.out.println(name.getName() + " : " + name.getType());
        name = enumSOName.next();
    }
}

catch (Exception e){
    e.printStackTrace();
}
You can get a reference to the ServerObjectManager through the AGSClient connection, provided that connection is a LAN connection. You can then use the methods exposed by the 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. Casting to IAGSServerConnection fails 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 the ServerObjectAdmin, you can perform administration tasks, such as starting and stopping server objects, and so on.
The ServerObjectConfiguration property returns the 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 succesfully get this property.
The name object for an MapServer or GeocodeServer server object is obtained through an AGSServerConnection. An application can call the Open method on the AGSServerObjectName to connect to and get an object reference to the MapServer or GeocodeServer object.
The IAGSServerObjectName interface lets you access the properties of an AGSServerObjectName which is the name object for an MapServer or GeocodeServer server object obtained through an AGSServerConnection. IAGSServerObjectName has properties for the server object's name, type and if connecting to a Web service catalog, the URL. See the following illustration:
The following code example shows how to create an AGSServerObjectName and open it to get a MapServer object through an AGSServerConnection LAN connection:
[Java]
try{
    IAGSServerConnectionName connectionName = new AGSServerConnectionName();
    PropertySet props = new PropertySet();
    props.setProperty("machine", "mercy");

    connectionName.setConnectionProperties(props);
    AGSServerObjectName soName = new AGSServerObjectName();
    soName.setName("SanFran");
    soName.setType("MapServer");
    soName.setAGSServerConnectionNameByRef(connectionName);

    IMapServer mapServer = (IMapServer)soName.open();

}

catch (Exception e){
    e.printStackTrace();
}

ArcIMS client

ArcGIS Engine developers can consume ArcIMS Server Web services using the ArcGIS Server client API (AGSClient), which is in the GISClient object library. In addition, AGSClient includes objects and methods for connecting to ArcIMS servers and ArcIMS services.
IMSServiceDescription provides access to get IMS connection properties. This includes 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 the following:
ArcIMS provides the image and feature map services. An ArcIMS image service is a raster representation of a map. When you add an ArcIMS image service to a map, you'll see a new layer on the map. This layer is an Internet map server map layer (IMSMapLayer). An IMSMapLayer is a composite layer consisting of 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 IMSFeatureClass interface provides members that control the ArcIMS feature class. These include the getLayerID, getMapUnits, and getAxl. Additional interfaces include: IIMSUserRole, IIMSServiceName, IIMSWorkspace, and IIMSWorkspaceFactory.