PDA

View Full Version : Crossdomain.xml file


nmarun
07-31-2008, 01:40 AM
Hi,

My site (http://www.arunmahendrakar.com) has a web service and it was working earlier with or without the www part, but it's not working now without the www part. I read a couple of articles which said there have been some changes in the security model of the latest version of flash. Below is my crossdomain.xml file:

<?xml version="1.0" encoding="utf-8" ?>
<cross-domain-policy>
<allow-access-from domain="*" />
<allow-http-request-headers-from domain="*" headers="*" />
</cross-domain-policy

Please let me know what I need to do so that the webservice call is successful for both http://www.arunmahendrakar.com and http://arunmahendrakar.com.

Thanks
Arun

nmarun
07-31-2008, 03:44 PM
Hi,

I solved this issue through a 'hack'. Initially, I had hard-coded the web service as 'http://www.mysite.com/WebService.asmx..', but now I'm capturing the domain name on which the flash file is running using a LocalConnection and then I build the path for the web service based on the domain name returned. My code now looks like this:

var localDomainLC:LocalConneciton = new LocalConnection();
myDomainName = localDomainLC.domain();
webServicePath = "http://" + myDomainName + "/WebService.asmx..'


This way, I don't have to worry, whether the request is coming from 'http://www.mysite.com' or 'http://mysite.com'.

Thanks
Arun