我开发了一个 flex 组件,我在 salesforce visualforce 页面上使用它。当我在本地机器上运行该 flex 组件时,它工作正常。但是当我通过salesforce页面运行我时它说
*** Security Sandbox Violation ***
Connection to https://ap1.salesforce.com/services/async/28.0/job/750900000004QUe/batch halted - not permitted from https://ashcloud.ap1.visual.force.com/resource/1375959623000/ashcloud__Flash/Salesforce_Bulk_Upload.swf
httpStatusHandler: [HTTPStatusEvent type="httpStatus" bubbles=false cancelable=false eventPhase=2 status=0 redirected=false responseURL=null]
securityErrorHandler: [SecurityErrorEvent type="securityError" bubbles=false cancelable=false eventPhase=2 text="Error #2170: Security sandbox violation: https://ashcloud.ap1.visual.force.com/resource/1375959623000/ashcloud__Flash/Salesforce_Bulk_Upload.swf cannot send HTTP headers to https://ap1.salesforce.com/services/async/28.0/job/750900000004QUe/batch."]
请注意,我已经从以下位置加载了 Salesforce 跨域文件:
Security.loadPolicyFile("https://www.salesforce.com/services/crossdomain.xml");
Security.loadPolicyFile("https://www.force.com/services/crossdomain.xml");
在控制台上显示警告:
Warning: Domain www.force.com does not explicitly specify a meta-policy, but Content-Type of policy file https://www.force.com/crossdomain.xml is 'text/x-cross-domain-policy'. Applying meta-policy 'by-content-type'.
Warning: Domain www.salesforce.com does not explicitly specify a meta-policy, but Content-Type of policy file https://www.salesforce.com/crossdomain.xml is 'text/x-cross-domain-policy'. Applying meta-policy 'by-content-type'.
当 flex 组件尝试访问 Salesforce Bulk API 时,它会显示安全错误。如何从 flex 组件中访问 API 并解决此安全问题?
谢谢