Select to view content in your preferred language

Newbie Question About Getting Service Information

748
5
Jump to solution
10-16-2013 04:09 AM
PaulHuppé
Deactivated User
Hi,
We have decided to port our Silverlight API application to JavaScript.  I am starting to look at the API and I am trying to find out how I can query an ArcGIS server to find a list of services. I need to ask it to return only specific type of services. For example, I want to be able to get only a list of dynamic, tiled, WMS or WMTS one type at a time.  I was looking at what the REST API returns, but it does not tell me the type I want.  It only says "MapServer" as the type in the JSON I get back. Is there something in the API that will help me?
Thanks,
Paul
0 Kudos
1 Solution

Accepted Solutions
ManishkumarPatel
Deactivated User
Hi,
We have decided to port our Silverlight API application to JavaScript.  I am starting to look at the API and I am trying to find out how I can query an ArcGIS server to find a list of services. I need to ask it to return only specific type of services. For example, I want to be able to get only a list of dynamic, tiled, WMS or WMTS one type at a time.  I was looking at what the REST API returns, but it does not tell me the type I want.  It only says "MapServer" as the type in the JSON I get back. Is there something in the API that will help me?
Thanks,
Paul


Hi Paul,

I am having a similar requirement, working with JavaScript API and used the following workaround:

http://help.arcgis.com/en/webapi/javascript/bing/help/bingsamples/serviceinfo_discover_map.html

You might have to modify the code a bit and you can pull up all the information as required. Let me know if you need any further help.

Hope this helps.

Happy coding 🙂

Regards,
Manish

View solution in original post

0 Kudos
5 Replies
ManishkumarPatel
Deactivated User
Hi,
We have decided to port our Silverlight API application to JavaScript.  I am starting to look at the API and I am trying to find out how I can query an ArcGIS server to find a list of services. I need to ask it to return only specific type of services. For example, I want to be able to get only a list of dynamic, tiled, WMS or WMTS one type at a time.  I was looking at what the REST API returns, but it does not tell me the type I want.  It only says "MapServer" as the type in the JSON I get back. Is there something in the API that will help me?
Thanks,
Paul


Hi Paul,

I am having a similar requirement, working with JavaScript API and used the following workaround:

http://help.arcgis.com/en/webapi/javascript/bing/help/bingsamples/serviceinfo_discover_map.html

You might have to modify the code a bit and you can pull up all the information as required. Let me know if you need any further help.

Hope this helps.

Happy coding 🙂

Regards,
Manish
0 Kudos
PaulHuppé
Deactivated User
Hi Manish,
I just tried that code. It returns all the services recursively in all folders whatever their type.  It shows all services as having a type of "MapServer". I need to extract all dynamic services only or all tiled services only for example.
0 Kudos
ManishkumarPatel
Deactivated User
Hi Manish,
I just tried that code. It returns all the services recursively in all folders whatever their type.  It shows all services as having a type of "MapServer". I need to extract all dynamic services only or all tiled services only for example.


Hi Paul,

You can try the following:
Once you have the map service name, create the map server URL dynamically.

for eg: if you have the map service name as ESRI_Census_USA  then create the map service URL as below dynamically:

var mapServURL = "http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer";

use this for the get the details of the map service.

// send request for service information
            agisve_services.GetResourceInfo(mapServURL , showMapServResourceInfo);
function showMapServResourceInfo(MapServResourceInfo){
//this MapServResourceInfo object has the map service details.

eg: MapServResourceInfo.singleFusedMapCache = false; //this means the map is dynamic.
}


Based on the properties who want you can decide what to show or do with the map service.

Hope this helps.

Thanks & Regards,
Manish
0 Kudos
PaulHuppé
Deactivated User
Hi,
I have talked to my client and we will modify our requirements and settle with what we can get out using the first sample you directed me too.

Thanks for your help.
Cheers,
Paul
0 Kudos
ManishkumarPatel
Deactivated User
Hi,
I have talked to my client and we will modify our requirements and settle with what we can get out using the first sample you directed me too.

Thanks for your help.
Cheers,
Paul


Glad to help. Please feel free to get back if you have any further queries. Also dont forget to mark the thread as answered so it can help others in future.

Regards,
Manish
0 Kudos