add a secure wms as basemap

2298
2
11-22-2013 05:35 AM
antoniodang
New Contributor
Hi!
I have build a map application with Arcgis flex 3.2 and right now im trying to add a wms layer as a basemap in my application
In Flexbuilder everything works fine when I run it. But when I build it and move the release folder into my application server i got
error messenger as below:

SecurityError: Error #2170: Security sandbox violation: http://apparcgis01/karta/e/index.swf cannot send HTTP headers to http://maps.lantmateriet.se/ortofoto-ar/wms/v1?VERSION=1%2E3%2E0&SERVICE=WMS&REQUEST=GetCapabilities.
 at MethodInfo-3067()
 at mx.rpc::AsyncResponder/fault()
 at mx.rpc::AsyncToken/http://www.adobe.com/2006/flex/mx/internal::applyFault()
 at mx.rpc.events::FaultEvent/http://www.adobe.com/2006/flex/mx/internal::callTokenResponders()
 at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
 at HTTPOperation/http://www.adobe.com/2006/flex/mx/internal::dispatchRpcEvent()
 at mx.rpc::AbstractInvoker/http://www.adobe.com/2006/flex/mx/internal::faultHandler()
 at mx.rpc::Responder/fault()
 at mx.rpc::AsyncRequest/fault()
 at DirectHTTPMessageResponder/securityErrorHandler()
 at flash.events::EventDispatcher/dispatchEventFunction()
 at flash.events::EventDispatcher/dispatchEvent()
 at flash.net::URLLoader/redirectEvent()


in config.xml the code is as below:

<!-- Backgrunskartan -->
  <basemaps>
   <layer label="Bakgrundkarta" type="tiled" visible="true" alpha="1"
    url="http://apparcgis01.kumla.internal:6080/arcgis/rest/services/baskarta/Karta/MapServer"/>
   <layer label="Flygfoto 2013 Kumla Tätort"  type="tiled" visible="false" alpha="1"  
    url="http://apparcgis01.kumla.internal:6080/arcgis/rest/services/baskarta/Flygbilder/MapServer"/>
   <layer label="Flygfoto 2010 kumla kommun" type="wms" username="xxx" password="xxx"
     url="http://maps.lantmateriet.se/ortofoto-ar/wms/v1?" version="1.1.0" visible="false"
     wkid="3006" visiblelayers="orto_2010"/> 
  </basemaps>


in my IIS, root, crosssdomain.xml the code is as below:

<?xml version="1.0" ?>
<cross-domain-policy>
  <allow-access-from domain="*"/>
  <site-control permitted-cross-domain-policies="all"/>
  <allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>


Does anyone know what is wrong with my application?
Tags (2)
0 Kudos
2 Replies
YueWu1
by Esri Regular Contributor
Esri Regular Contributor
Hi Antonio,

I think the error stems from the cross-domain issue. "Security error accessing url" faultCode="Channel.Security.Error" is thrown when the web service to be accessed is not of the same protocol.

I found this thread related to the error:http://forums.adobe.com/thread/223999, they recommend to replace crossdomain.xml

<?xml version="1.0"?>
<!DOCTYPE cross-domain-policy SYSTEM "/xml/dtds/cross-domain-policy.dtd">
<cross-domain-policy>
<site-control permitted-cross-domain-policies="all"/>
<allow-access-from domain="*" to-ports="*" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>

Also, there is another old thread in esri forum:
http://forums.esri.com/Thread.asp?c=158&f=2421&t=294393

Hope this can help.
0 Kudos
DasaPaddock
Esri Regular Contributor
Are you able to update this?
http://maps.lantmateriet.se/crossdomain.xml
0 Kudos