3

I'm working on an application that has to access data from a server. The flex application uses Esri's World_Imagery basemap and is able to access ESRI_Census_USA from the sample server.

Here are the two active lines of my code (almost directly copy and pasted from their tutorial.

<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" />
<esri:FeatureLayer graphicAdd="featurelayer1_graphicAddHandler(event)" outFields="[*]" url="http://sampleserver1.arcgisonline.com/ArcGIS/rest/services/Demographics/ESRI_Census_USA/MapServer/0" />

This works just fine as long as I want to show census data, but if I try to access the ArcGIS Server software running on my machine (the same machine), nothing appears. To do this I change the code in the second line to this:

https://localhost:6443/arcgis/rest/services/Pennwell/MapServer/0

Even the SampleWorldCities layer on the server won't load, so it's either the Flex application not accessing the server properly or it's the server itself not being set up right (there might be something else going on, too, but these are the most likely as far as I can tell).

Screenshot of the ArcGIS for Server Manager

I am able to get the SampleWorldCities (and my other data) to open in the online viewer without any problems.

How do I go about getting my Flex application to talk to the server?

  • Do you have a crossdomain.xml file placed on the web server hosting the ArcGIS for Server site? developers.arcgis.com/flex/guide/using-crossdomain-xml.htm – Eok Apr 27 '16 at 18:01
  • I just added one, but both the client and the server are running on the same machine, so it shouldn't be necessary - right? I added it at C:\Program Files\ArcGIS\Server\framework\runtime\tomcat\contexts\rootapp – Olin Kirkland Apr 27 '16 at 21:19
  • It should go in C:\inetpub\wwwroot assuming you're using IIS as the web server (which I assume since you're on a windows machine) – Eok Apr 27 '16 at 22:10
  • Still nothing. I downloaded Fiddler and it doesn't look like requests are actually being made. Screenshot – Olin Kirkland Apr 28 '16 at 14:50
  • Try using the unsecured version first. Try accessing localhost:6080/arcgis/rest/services/Pennwell/MapServer/0 or substituting your server name in for localhost – Eok Apr 28 '16 at 16:29
1

Two things to check:

  • Add a crossdomain.xml file to the web server.
    ArcGIS API for Flex - Crossdomain usage documentation

  • Use the unsecured version of the the map service since HTTPS is not turned on by default for most versions of ArcGIS for Server. (Substitute localhost with the server name if needed.)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.