Select to view content in your preferred language

WMSLayer display perfectly in arccatalog and arcmap but in flex

1113
5
03-02-2011 06:18 AM
DamonSong
Emerging Contributor
Hi,
    I publish a map service with WMS capability, it displays perfectly when added to arcmap and previews in arccatalog, but shows nothing in flex project using WMSLayer, the arcgis api for flex is 2.2. Any suggestions?
    thanks in advance for any help!
following is my code.
<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
      xmlns:s="library://ns.adobe.com/flex/spark"
      xmlns:esri="http://www.esri.com/2008/ags">
 <fx:Script>
  <![CDATA[
   import com.esri.ags.Units;
  ]]>
 </fx:Script>
 <esri:Map units="{Units.DECIMAL_DEGREES}">
  <esri:WMSLayer 
   url="http://sdm:8399/arcgis/services/nef/MapServer/WMSServer"/>
 </esri:Map>
</s:Application>
Tags (2)
0 Kudos
5 Replies
DasaPaddock
Esri Regular Contributor
Are you accessing your Flex app at http://sdm:8399/...? If not, you'll need a crossdomain.xml file at http://sdm:8399/crossdomain.xml

See References book at:
http://help.arcgis.com/en/webapi/flex/help/index.html
0 Kudos
DamonSong
Emerging Contributor
Are you accessing your Flex app at http://sdm:8399/...? If not, you'll need a crossdomain.xml file at http://sdm:8399/crossdomain.xml

See References book at:
http://help.arcgis.com/en/webapi/flex/help/index.html


thanks for your reply!
    i try your suggestion, but it still does not work. My crossdomain.xml is located at "Server10.0\java\manager\web_output\crossdomain.xml", and i can get it at http://sdm:8399/crossdomain.xml
    the screenshots are attached.
0 Kudos
DasaPaddock
Esri Regular Contributor
Can you use a tool like Fiddler or HttpFox to see what requests are being made to your service and what the responses are?
0 Kudos
HugoDurana
Emerging Contributor
@xgyb12458

From the code:
http://sdm:8399/arcgis/services/nef/MapServer/WMSServer

I am sorry to point out the possible obvious, but i think you forgot the rest part of the URL e.g:
http://sdm:8399/arcgis/rest/services/nef/MapServer/WMSServer
0 Kudos
DasaPaddock
Esri Regular Contributor
xgyb12458,

You need to specify at least one visible layer.

hugo.durana,

The WMS layer does not use the REST endpoint.

See sample at:
http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=WMS
0 Kudos