我在这上面花了很多时间,所以这就是我卡住的地方。
我正在使用调试播放器 10.1 从以下位置获取 XMLA 请求:
http://localhost/dir/blah.swf
到:
http://localhost/olapbin/msblah.dll
这在文件系统中运行良好,但现在它在 IIS7 Web 服务器上。
经过大量摆弄 crossdomain.xml 文件后,我决定:
<?xml version="1.0"?>
<cross-domain-policy>
<site-control permitted-cross-domain-policies="master-only"/>
<allow-access-from domain="*" to-ports="*" />
<allow-http-request-headers-from domain="*" headers="*"/>
</cross-domain-policy>
放置在:
http://localhost/crossdomain.xml
并阅读:
Security.loadPolicyFile("http://localhost:80/crossdomain.xml");
我设置了策略文件日志记录(这有助于提出上述文件),并且在 IE8 上它一切正常。我得到:
OK: Root-level SWF loaded: http://127.0.0.1/akts/ThinSlicerRunner.swf
OK: Policy file accepted: http://localhost/crossdomain.xml
OK: Searching for <allow-access-from> in policy files to authorize data loading from resource at http://localhost/olapbin/msmdpump.dll by requestor from http://127.0.0.1/akts/ThinSlicerRunner.swf
OK: Searching for <allow-http-request-headers-from> in policy files to authorize header sending to URL http://localhost/olapbin/msmdpump.dll by requestor from http://127.0.0.1/akts/ThinSlicerRunner.swf
OK: Request for resource at http://localhost/olapbin/msmdpump.dll by requestor from http://127.0.0.1/akts/ThinSlicerRunner.swf is permitted due to policy file at http://localhost/crossdomain.xml
在 Chrome 和 Firefox 上,我得到:
OK: Root-level SWF loaded: http://localhost/akts/ThinSlicerRunner.swf
OK: Policy file accepted: http://localhost/crossdomain.xml
没有别的……没有尝试授权 httpservice 请求。
在主 flex 错误日志中,我得到:
*** Security Sandbox Violation ***
Connection to
http://localhost/olapbin/msmdpump.dll
halted - not permitted from http://localhost/akts/ThinSlicerRunner.swf
当我从 IE8 运行相同的东西时,它不会出现。知道发生了什么吗?
根据要求...更多代码
主要发送请求:
var connection:TsConnection = this.__connection;
var token:AsyncToken = new AsyncToken(null);
connection.service.request = this.__curSoapRequest;
var actualToken:AsyncToken = connection.service.send();
__tokenArr.push(actualToken);
var responder:AsyncResponder = new AsyncResponder(resultHandler, faultHandler, actualToken);
__responderArr.push(responder);
actualToken.addResponder(responder);
连接对象亮点:
public function init():void {
//Initialize the service object needed to query the server
this.__service = new HTTPService;
this.__service.method = "POST";
this.__service.contentType = "application/xml";
this.__service.resultFormat = "e4x";
this.__service.headers = getHeaders();
this.__service.url = this.__model.xmlaUrl;
this.__initialized = true;
}
public function get service():HTTPService {
return this.__service;
}
private function getHeaders():Object {
var o:Object = {};
o["SOAPAction"] = '"urn:schemas-microsoft-com:xml-analysis:Discover"';
o["Content-Type"] = "text/xml";
return o;
}
感谢您的帮助...希望在修复后对其他人有所帮助。;-)