Adding WMS layer without crossdomain.xml after map load in Flex

المشرف العام

Administrator
طاقم الإدارة
I have a problem with loading a WMS layer using a widget made for Flex Viewer. The server i want to use doesnt have a crossdomain.xml file. Ill show a lot of info here so sorry for a little chaos, but I need a clue whats going wrong.

When I add this layer to config.xml, its working. The site makes a call for crossdomain.xml (results 404) but the layer somehow still works. The code:

However if I try to load this layer using a widget it gives a security error.

[FaultEvent fault=[RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"] messageId="62DC1CFD-5BD7-DD2E-44A2-9D0782B55D4C" type="fault" bubbles=false cancelable=true eventPhase=2]Everything is working when Im running a local version (using Flex Viewer debug). However if I build the app and put in on server, thats a call for crossdomain.xml the security error occurs.

Widget works like this:

1. call layer url with getcapabilities as XML2. declare new WMSLayer object3. set the WMSLayer object parameters using values form XML4. add layer to mapThe separate call for getcapabilities its from my predecessors code. I tried disabling it and turning skipGetCapabilities="false" but it gives me error:

TypeError: Error #1009: Cannot access a property or method of a null object reference. at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/createChildren() at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/onLayerLoad()on the 472 line of TocMapLayerItem.as file, thats this line:

if (wmsVisibleLayers.source.indexOf(wmsLayerInfo.name) !== -1)I tried to make a proxy, but thats not working - when on a server my app just tries to call server with WMS layer for crossdomain.xml, and thats all, not trying to use proxy at all.

Im glad for any help or a clue of whats going on. Im pretty new to Flex Viewer, I know the crossdomain.xml is needed, but they are not willing to set it up on server, the client wants layers from this server to be available, and THEY ACTUALLY WORK when i simply put them in config.xml instead od trying to add to map later.

Also my app gives me an error just after loading, dont know if this has somethin go do with the WMS problem but here it is:

TypeError: Error #1034: Type Coercion failed: cannot convert _index_mx_managers_SystemManager@d3a0999 to flash.display.Bitmap. at spark.primitives::BitmapImage/contentComplete() at spark.primitives::BitmapImage/http://www.adobe.com/2006/flex/mx/internal::loader_completeHandler()

أكثر...
 
أعلى