Apache flex 在Flex中访问Google API-部署后出现安全错误。
我正在使用Google地理编码API(JSON URL)来执行一些地理编码工作。我可以让它在开发箱中工作。但是,一旦我将应用程序部署到IIS,我就遇到了一个安全错误,并告诉我URL无法访问 这是留言。 访问ULR时发生安全错误-通道安全错误 这是我使用的源代码。我非常确定URL是正确的,因为我可以通过直接在IE中访问它来获得结果Apache flex 在Flex中访问Google API-部署后出现安全错误。,apache-flex,geocoding,Apache Flex,Geocoding,我正在使用Google地理编码API(JSON URL)来执行一些地理编码工作。我可以让它在开发箱中工作。但是,一旦我将应用程序部署到IIS,我就遇到了一个安全错误,并告诉我URL无法访问 这是留言。 访问ULR时发生安全错误-通道安全错误 这是我使用的源代码。我非常确定URL是正确的,因为我可以通过直接在IE中访问它来获得结果 //call google url serive var httpService : HTTPService = new HTTPSer
//call google url serive
var httpService : HTTPService = new HTTPService( );
var temps:String = itemg["ADDRESS_1"] + "," + itemg["CITY"] + "," + itemg["STATE"];
temps = CSVUtil.str_replace(temps,",",",+");
temps = CSVUtil.str_replace(temps, " ","+");
//var urlstring = "http://maps.googleapis.com/maps/api/geocode/json?address=" + temps + "&sensor=false";
var urlstring:String = googleurl + temps + "&sensor=false";
Alert.show(urlstring);
httpService.url = urlstring;
httpService.addEventListener(ResultEvent.RESULT, resultFunction);
httpService.addEventListener(FaultEvent.FAULT, faultfunction);
httpService.send();
Alert.show("request send out");
尝试在web服务器根文件夹中添加crossdomain.xml
<?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="*" secure="false"/>
<allow-http-request-headers-from domain="*" headers="*" secure="false"/>
</cross-domain-policy>