Introduction to ArcXML
 
ArcXML is the protocol for communicating with the ArcIMS Spatial Server. An ArcIMS Spatial Server is the backbone of ArcIMS and provides the functional capabilities for accessing and bundling maps and data into the appropriate format before sending the data back to a client. In order to understand ArcXML, it is first necessary to understand the relationship between map configuration files, MapServices, requests, and responses and how they interact with the ArcIMS Spatial Server.

The figure below is a diagram showing the interaction between the ArcIMS Spatial Server and map configuration files, MapServices, requests, and responses. The numbers in the diagram reflect the different steps involved in communicating with the Spatial Server:
 

Step 1: Creating a Map Configuration File

In Step 1, a map configuration file is generated. You can create a map configuration file using Author or by using a text or XML editor. This file, written in ArcXML, contains information about a map's characteristics including what data layers are used and how each layer looks. The next figure shows a map in ArcIMS Author with two layers: STATES and CITIES.
 
When this file is saved in ArcIMS Author, the result is a map configuration file containing layer information on STATES and CITIES. The file has an *.axl extension. In this example, assume the file is named usa.axl.
 
Usa.axl map configuration file using ArcXML:
<?xml version="1.0" encoding="UTF-8"?>
<ARCXML version="1.1">
  <CONFIG>
    <ENVIRONMENT>
      <LOCALE country="US" language="en" variant="" />
      <UIFONT color="0,0,0" name="Arial" size="12" style="regular" />
    </ENVIRONMENT>
    <MAP>
      <PROPERTIES>
        <ENVELOPE minx="-125" miny="25" maxx="-67" maxy="50" name="Initial_Extent" />
        <MAPUNITS units="decimal_degrees" />
      </PROPERTIES>
      <WORKSPACES>
        <SHAPEWORKSPACE name="shp_ws-0" directory="C:\ESRIDATA\USA" />
      </WORKSPACES>
      <LAYER type="featureclass" name="STATES" visible="true" id="0">
        <DATASET name="STATES" type="polygon" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEPOLYGONSYMBOL fillcolor="0,0,255" filltype="solid" />
        </SIMPLERENDERER>
      </LAYER>
      <LAYER type="featureclass" name="CITIES" visible="true" id="1">
        <DATASET name="CITIES" type="point" workspace="shp_ws-0" />
        <SIMPLERENDERER>
          <SIMPLEMARKERSYMBOL color="255,0,0" width="6" />
        </SIMPLERENDERER>
      </LAYER>
    </MAP>
  </CONFIG>
</ARCXML>
 
The element that distinguishes a map configuration file from a request or response is CONFIG. Elements within the CONFIG element, such as PROPERTIES, WORKSPACES, and LAYER, help define the characteristics of the map.

Step 2: Starting a MapService

A MapService is a process that runs on the ArcIMS Spatial Server. You can think of a MapService as a portal to the Spatial Server. Spatial Server functionality is accessible only through MapServices running on the server.

In Step 2, a map configuration file such as usa.axl is the primary input to a MapService. When starting a MapService, you also must assign the MapService to a FeatureServer or ImageServer. In either case, a map configuration file provides drawing instructions for each layer in a MapService. These instructions are the default state for the MapService.

The naming of a MapService is independent of the name of the input map configuration file. For example, the usa.axl file can be the input file to an Image MapService named usa_image. This MapService is instructed, by default, to draw the STATES layer with a blue polygon fill and the CITIES layer with a red marker.

Step 3: Sending a Request

In Step 3, once a MapService such as usa_image is running on the ArcIMS Spatial Server, requests can be sent to the MapService. Requests are generated by the ArcIMS HTML Viewer, Java Viewers, the ColdFusion and ActiveX Connectors, and custom connectors using the ArcIMS Application Server Link. The five requests are: The element that distinguishes a request from other types of ArcXML files is REQUEST. For example, to request a map, a GET_IMAGE request can be made:
 
A sample request:
<?xml version="1.0" encoding="UTF-8" ?>
<ARCXML version="1.1">
  <REQUEST>
    <GET_IMAGE>
      <PROPERTIES>
        <ENVELOPE minx="-125" miny="25" maxx="-67" maxy="50" />
      </PROPERTIES>
    </GET_IMAGE>
  </REQUEST>
</ARCXML>
 
 
When the above request is sent to the usa_image MapService, the result is a map that looks like the original map defined in ArcIMS Author. The layer symbol definitions from the MapService are used: blue for the states and red for the cities.
 
A request can also override some of the information in a MapService by asking for a new map at a different scale, changing the color of a layer, turning layers on and off, requesting a subset of the attribute data, changing the projection, or adding dynamic layers, among other things. In the next example, a request is sent to the usa_image MapService asking for information at a new zoom scale and changing the color of the STATES layer from blue to yellow.
Request to change the zoom area and layer color of a MapService:
<?xml version="1.0"?>
<ARCXML version="1.0">
  <REQUEST>
    <GET_IMAGE>
      <PROPERTIES>
        <ENVELOPE minx="-88" miny="30" maxx="-67" maxy="50.0" />
        <IMAGESIZE width="500" height="350" />
        <LAYERLIST>
          <LAYERDEF id="0" visible="true" >
            <SIMPLERENDERER>
              <SIMPLEPOLYGONSYMBOL filltype="solid" fillcolor="255,255,0" />
            </SIMPLERENDERER>
          </LAYERDEF>
        </LAYERLIST>
      </PROPERTIES>
    </GET_IMAGE>
  </REQUEST>
</ARCXML>
 
The new map, when drawn, has new rendering for the States layer at a zoomed in scale.
 

Step 4: Receiving a Response

In Step 4, when the ArcIMS Spatial Server processes a request, the results are returned in a response. The element that distinguishes a response from other types of ArcXML files is RESPONSE. For example, an IMAGE response contains the name and location of the map generated by the ArcIMS Spatial Server. The following example shows a possible IMAGE response from the usa_image MapService.
 
A sample response:
<?xml version="1.0"?>
<ARCXML version="1.0">
  <RESPONSE>
    <IMAGE>
      <ENVELOPE minx="-87.5" miny="30.0" maxx="-59.5" maxy="50.0" />
      <OUTPUT file="C:\ArcIMS\output\usa_image_MYCOMPUTER2953026.jpg" url="http://mycomputer.domain.com/output/usa_image_MYCOMPUTER2953026.jpg" />
    </IMAGE>
  </RESPONSE>
</ARCXML>
 
There are five responses in ArcIMS that correspond to the requests as shown in the following table.
Request Response More Information
GET_IMAGE IMAGE Using GET_IMAGE and IMAGE
GET_FEATURES FEATURES Using GET_FEATURES and FEATURES
GET_GEOCODE GEOCODE Summary of Geocoding Elements
GET_EXTRACT EXTRACT Using GET_EXTRACT and EXTRACT
GET_SERVICE_INFO SERVICEINFO Using GET_SERVICE_INFO and SERVICEINFO