How to know if a service exist ?

This is must wanted method for the developer:

I would also recommend using HTTPService to send the f=json request. (Set resultFormat to “text”.) This way you can parse the response (http://code.google.com/p/as3corelib/) to see if it’s a cached service (singleFusedMapCache is true) or not and then use the AGS dynamic or AGS tiled layer.

If you skip this and just try the URL in a AGS dynamic layer, then listen for the loadError event.
http://resources.esri.com/help/9.3/arcgisserver/apis/flex/apiref/com/esri/ags/layers/Layer.html#event:loadError

This is thrown if it can’t load the json for the service. The ioError is thrown if it can’t download the map image:
http://resources.esri.com/help/9.3/arcgisserver/apis/flex/apiref/com/esri/ags/layers/DynamicMapServiceLayer.html#event:ioError

Advertisements

2 Responses to “How to know if a service exist ?”

  1. Mike Says:

    Just passing by.Btw, your website have great content!

  2. iamlaksh1 Says:

    Thanks Mike

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


%d bloggers like this: