Sandbox problems when flex calls ASP. NET Web Service

Source: Internet
Author: User
Today, when I used flex to call ASP. NET web services, I always jumped out of the "Security Error accessing URL" error. I checked the information and found out that the sandbox of the original flash was related.

The principle is that when the SWF file tries to access data in other domains, Flash Player automatically loads the policy file in that domain. If the domain where the SWF file is located is included in this policy file, data can be accessed; otherwise, data cannot be accessed. The following is the official Adobe article:

When a SWF file attempts to access data from another domain,Flash Player automatically attempts to load a policy file from that domain.If the domain of the SWF file that is attempting to access the data is stored in the policy file, the data is automatically accessible.

The problem I encountered is that the policy file is not available on IIS, and the solution is to add the policy file.

Solution:

Create an XML file named crossdomain. xml. If you do not need to worry about it, use this file name instead.
copy the following content to an XML file: XML version = "1.0" ?>
Cross-Domain-policy >
allow-access-from domain =" * " />
Cross-Domain-policy >

Save it to wwwroot. I tried to put it in the application.ProgramBut it does not work. You can put it under wwwroot. The above crossdomail. xml allows all SWF files to access the local host.

Then OK. For more details, see:
Http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm? Context?livedocs_book_parts&file=05b_security_176_04.html

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.