Tag Archives: Web API
Have you ever come to the ArcGIS Resource Center and checked out or tried the samples built using one of the Web APIs? If you haven’t, these samples can be found at the following links:
For those of you who have tried some of these samples, I want to provide some quick troubleshooting tips to help you when your local map services are not working with the samples.
Let’s look at the following scenario: You check out the samples online, they work well. You copy the code over to your local machine and run them there, they work great. Now, you want to use your local ArcGIS Server map services. So, you publish a map service using ArcCatalog or Server Manager, and you are able to preview it. You then make changes to the REST service endpoint in the code and run your Web API-based application, but the map doesn’t appear in the Web browser. In this situation, here are a few things that you could test:
- Check if you can view the map in the REST Services Directory.
If you cannot view the map, it could potentially be an issue with the installation, and the first thing I would suggest is adding a new instance of ArcGIS Server Manager. Please see the following knowledge base article for more information: HowTo: User the AddInstance utility to create a new instance of ArcGIS Server Manager.
- Check if a cross-domain access policy file exists.
If you are working with either the Silverlight API or the Flex API, you will need to check for a cross-domain access policy file. To access data from a different server than the one hosting your Flex or Silverlight application, the remote server needs to have a cross-domain policy file in the root directory. This can be done by using a clientaccesspolicy.xml or crossdomain.xml. In most cases, you just need to place the .xml file at the root of your Web site (e.g., for IIS, c:inetpubwwwroot). Please see the following ArcGIS Web Help article for more information: Deploying your application.
- Check if the cross-domain access policy file has proper permissions. If you have placed the cross-domain access policy file but the application still doesn’t display the map, make sure you can access the cross-domain access policy file in a Web browser. If you can’t, check for permissions on the file. Make sure ‘Internet Guest Account’ has the permission set to ‘read (and execute)’ this file.
Other potential issues:
- Make sure the extent that you are setting is using the correct values, i.e., the values are in-line with the spatial reference of the map service.
- Make sure you are using the right layer class, for example, for a cached map service, use ArcGISTiledMapServiceLayer class.
I hope these troubleshooting tips help you to get your local map services working with the samples from the ArcGIS Resource Center.
- Kripa J., Esri Support Analyst – SDK group, Esri Support Services