Administering an ArcIMS Server


Summary
The ArcIMS application programming interface (API) provides methods for administering an ArcIMS Server. Administration requires Transmission Control Protocol (TCP) (local area network [LAN]) access to an ArcIMS Application Server. The ESRI.ArcGIS.ADF.IMS.Administration namespace contains a Service class with static methods to add, remove, stop, start, and save the current configuration. Each Service method references the name of the machine on which the ArcIMS Application Server is available, the connector port defined in the AppServer.properties file, the service parameters or service name, and the administrative user name and password.

In this topic


Adding and removing services

The Service.AddService() method adds a service to an ArcIMS Server. It requires the instantiation of a ServiceParameters instance to store service-specific information. ServiceParameters defines the following properties:
  • CleanUpInterval—Defines the number of minutes before the ArcIMS Tasker removes images generated by the ArcIMS Spatial Server.
  • Directory—The ArcIMS Spatial Server needs to know where to create map or legend images for clients of ArcIMS image services. The location is not validated by the Service class.
  • ImageFormat—The Application Developer Framework (ADF) maintains a standard set of image types as static properties on the ESRI.ArcGIS.ADF.Web.ImageFormat class.
  • MapFile—The location of the map configuration file (.axl). The path must be valid from the ArcIMS API and the ArcIMS Application Server. 
  • Name—Name of the service.
  • PixelLimit—Defines the maximum image size (expressed in number of pixels) possible when generating an output image from an image service.
  • VirtualDirectory—An ArcXML response containing the location of an image for an ArcIMS image service including a uniform resource locator (URL) to the image. The URL is not validated by the Service class; however, it must be valid from the client perspective to view the output images generated by the ArcIMS Spatial Server.
  • VirtualServer—The name of the virtual server used to expose the service. The virtual server name cannot be discovered programmatically.
These properties are shown in the following code example:
A service must be started after it is added.
[C#]
ServiceParameters sparams = new ServiceParameters();
sparams.CleanUpInterval = 10;
sparams.Directory = "c:\\arcims\\output";
sparams.ImageFormat = ESRI.ArcGIS.ADF.Web.ImageFormat.JPG;
sparams.MapFile = "\\\\myservername\\myshare\\ArcIMS\\Axl\\myservice.axl";
sparams.Name = "myservice";
sparams.PixelLimit = 2000000;
sparams.VirtualDirectory = "http://mywebserver/output";
sparams.VirtualServer = "ImageServer1";
Service.AddService("myserver", 5300, sparams, "admin_user", "admin_password");
The Service.RemoveService() method removes an existing service from an ArcIMS Server as shown in the following code example:
[C#]
Service.RemoveService("myserver", 5300, "myservice", "admin_user", "admin_password");

Starting and stopping services

The Service.StartService() method starts an existing service on an ArcIMS Server as shown in the following code example:
[C#]
Service.StartService("myserver", 5300, "myservice", "admin_user", "admin_password");
The Service.StopService() method stops an existing service on an ArcIMS Server as shown in the following code example:
[C#]
Service.StopService("myserver", 5300, "myservice", "admin_user", "admin_password");

Saving service definitions stored by the ArcIMS Application Server

Any changes to services associated with an ArcIMS Server persist as long as the ArcIMS Application Server is running. To persist changes, after the ArcIMS Application Server is restarted, the state of the application server must be saved. When the Service.Save() method is called, the current state of the ArcIMS Application Server is saved in the ArcIMSSite.sez file on the ArcIMS Application Server machine. This process is shown in the following code example:
[C#]
Service.Save("myserver", 5300, "admin_user", "admin_password");