Select to view content in your preferred language

Map Service not loading using Flex API

4460
10
01-26-2011 05:46 AM
VinayVyas
Emerging Contributor
Hi Friends,

I am new to ArcGIS and ArcGIS server. I created a service and used the arcgis manager to deploy a web application. So far so good. My goal is to use my .mxd file and use flex to view it on a web page and design my custom interface to interact with it.

I used the code samples given online and ran it using my flash builder. These also work.

The issue is when I try to use the map URL of my local ArcGIS server in my flash builder, it does not work. I see a blank screen.

My Flex code

<?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
    xmlns:esri="http://www.esri.com/2008/ags">
<esri:Map>
<esri:ArcGISImageServiceLayer url="http://8HGXXXX:8399/arcgis/services/My_Map/MapServer" />
</esri:Map>

</mx:Application>

I shall be thankful if you can suggest me how to resolve this.

PS: The numbers have been censored for security.
Tags (2)
0 Kudos
10 Replies
RobertScheitlin__GISP
MVP Emeritus
Vinay,

The issue is that you do not have "rest" in your url.

http://8HGXXXX:8399/arcgis/rest/services/My_Map/MapServer
0 Kudos
VinayVyas
Emerging Contributor
Hi Robert,

Thanks for the suggestion but it did not work.
The URL displayed is different in my arcgis manager, there is no "rest" in it.
This is a local map(mxd), created a service with the existing URL and I believe the maps online have the 'rest' directory.

Is there anything else that might be wrong?

Thanks,
Vinay
0 Kudos
VinayVyas
Emerging Contributor
Hi Robert,

I am surprised, if I browse the URL formed by the addition of rest, then it does navigate to a page containing information. I am not sure why it is not working in Flex.

It works with the sample code online.

here is my code again, do you find anything else wrong with it?

?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
   xmlns:esri="http://www.esri.com/2008/ags">
<esri:Map>

<esri:ArcGISImageServiceLayer url="http://8HGXXXX:8399/arcgis/rest/services/map/MapServer" />

</esri:Map>

</mx:Application>

Thanks,
Vinay
0 Kudos
DasaPaddock
Esri Regular Contributor
0 Kudos
VinayVyas
Emerging Contributor
Hi Dasa,

Its still not working. I am surprised what the problem is, it is showing similar behavior using the Javascript API. The map is also error-free.

Thanks,
Vinay
0 Kudos
DasaPaddock
Esri Regular Contributor
Can you try a tool like HttpFox to see if it's trying to load: http://8HGXXXX:8399/crossdomain.xml
Also, see if any other requests are failing.
0 Kudos
AndyGup
Esri Regular Contributor
0 Kudos
ScottEvenson
Emerging Contributor
Hi Robert,

I am surprised, if I browse the URL formed by the addition of rest, then it does navigate to a page containing information. I am not sure why it is not working in Flex.

It works with the sample code online.

here is my code again, do you find anything else wrong with it?

?xml version="1.0" encoding="utf-8"?>

<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
    layout="absolute"
   xmlns:esri="http://www.esri.com/2008/ags">
<esri:Map>

<esri:ArcGISImageServiceLayer url="http://8HGXXXX:8399/arcgis/rest/services/map/MapServer" />

</esri:Map>

</mx:Application>

Thanks,
Vinay



Vinay, you may have already solved this, but if you add /0 at the end of the url it might work.
so yours would look like: url="http://8HGXXXX:8399/arcgis/rest/services/map/MapServer/0" />

-Scott
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Scott,

   Before you post this on other threads you need to understand that adding the /0 to the end of the url basically is saying use the first layer of the map service that is specified in the url. An ArcGISDynamicMapServiceLayer does not support the specification of a specific layer in it's url. A FeatureLayer however does support this as well as a QueryTask that is expecting an individual layer of a map service to be specified.
0 Kudos