Accomplish "GET SERVICE INFO" of ArcGIS Server Service with Flex API?

534
1
09-10-2010 07:49 AM
IvanBrown
New Contributor III
I used to use the GET_SERVICE_INFO ArcXML element with ArcIMS to get service information, such as layer names, field names, and field types.  That technology would return error information when the service is not available.

Now, I want to detect if ArcGIS Server services are available through our Flex app.  I didn't find a class (1.3 library) that accomplishes the same thing as the old GET_SERVICE_INFO.  I did try to use the getLayerDetails of an ArcGISDynamicMapServiceLayer object to see if anything comes back to the responder when getting layer details for the first layer (0);  I wanted to handle the case in which the service is not running (error trapping)...  The fault function would inform the user that the service appears to be down.

I stopped the service in ArcGIS Server Manager, waited for the REST API to refresh, and tried my approach.  The app still gets layer details returned, even when the service is stopped!  I was surprised.

Do you know of a good approach to detecting service availability and acquiring information on the layers that are available in a service?  I really want to trap error conditions, such as "service not available," and "expected layer does not exist in service."
Tags (2)
0 Kudos
1 Reply
DasaPaddock
Esri Regular Contributor
Are you listening to loadError like this?

    <esri:Map>
        <esri:ArcGISDynamicMapServiceLayer id="lyr"
                                           load="trace(event)"
                                           loadError="trace(event)"
                                           url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Foo/MapServer"/>
    </esri:Map>
0 Kudos