Select to view content in your preferred language

ArcGIS Viewer for Flex - adding operational layers from remote Arc Server

1105
6
06-08-2011 05:18 AM
MagdaGolubowska
Emerging Contributor
Hi there,

I am new to Flex Viewer and am currently trying to view my Map Service that comes from remote Arc GIS Server over the Internet. All parameters in the config.xml file are set up as default (I made no changes to the original file) and I am trying to add a new operational layer. I have installed (locally) Apache 2.2 as my local web server and Flexviewer v 2.3.1. I am therefore using the Flexviewer through my localhost.

My map service using a single feature class, file geodatabase with the data and mxd data frame set to WGS_1984_Web_Mercator_Auxiliary_Sphere, to be consistent with the basemap layers from arcgis online.

I haven't got the ability to install flex viewer on the actual ArcGIS service (in a different office) but I have access via ArcCatalog and ArcGIS Server Manager.

I assume the problem is either
a) the URL structure specifying the map service, or
b) some issue with that fact that I'm using a remote ArcGIS Server map serivce?

Below is the code used in config.xml specifying my map service. Is this correct?

        <operationallayers>
            <layer label="test" type="feature" visible="true"
                   url="http://myserver/arcgis/rest/services/myservice_wgs84wm/MapServer/"
        </operationallayers>   ,

where 'myservice_wgs84wm' is the name of my map service, served from my ArcGIS Server (named above as 'myserver').

Can anyone advise on the structure of my URL? Do I need to include 'REST' parameter - I don't really understand this?

I'd be grateful for any help!!

Thanks

Magda
Tags (2)
0 Kudos
6 Replies
JoshWhite
Honored Contributor
your type should be tiled or dynamic not feature
Josh White, AICP
Principal Planner

City of Arkansas City
0 Kudos
LarryJahn
Frequent Contributor
Could this be a crossdomain.xml issue?  I had the same issue when setting up my flex map.  The operational layers code was written correctly, but I was still unable to view the REST service in my flex app.  After I placed a copy of the crossdomain.xml file in the inetpub-->wwwroot directory of the server running ArcServer, my app worked properly.  Good luck!
0 Kudos
JustinRobinson
Deactivated User
While I'm not wholly sure about the crossdomain.xml being required, however your type is set incorrectly for a /MapServer/ . The "feature" type is for single layers from a service, you are after type="Dynamic" ( http://help.arcgis.com/en/webapps/flexviewer/help/index.html#/The_Layer_tag/01m30000000p000000/ ). As well your missing a ' /> '

<operationallayers>
<layer label="test" type="dynamic" visible="true"
url="http://myserver/arcgis/rest/services/myservice_wgs84wm/MapServer/" />
</operationallayers>
0 Kudos
JohnCodd
Regular Contributor
Could this be a crossdomain.xml issue?  I had the same issue when setting up my flex map.  The operational layers code was written correctly, but I was still unable to view the REST service in my flex app.  After I placed a copy of the crossdomain.xml file in the inetpub-->wwwroot directory of the server running ArcServer, my app worked properly.  Good luck!


Hello: I need to access a map service tht is outside my domain, so I believe I need to employ this crossdomain.xml solution.  Where do I get this crossdomain.xml file that I need to place in my inetpub directory?  Is this a generic file, or is it a file found on the server that I getting the map service from that I need to copy and paste from?  Thank you very much.  John
John Codd
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
John,

  Here is a link to info about crossdomain xml files:

http://help.arcgis.com/en/webapi/flex/help/017p/017p0000001w000000.htm
0 Kudos
LarryJahn
Frequent Contributor
John:

As displayed in the link provided by Robert, here is the crossdomain.xml file I used:

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "http://www.adobe.com/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
    <site-control permitted-cross-domain-policies="all"/>
    <allow-access-from domain="*"/>
</cross-domain-policy>
0 Kudos