本文介绍了在Chrome / Firefox中Flex crossdomain.xml无法正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我使用调试播放器10.1来获取XMLA请求从:

  http://localhost/dir/blah.swf 

to:

  http:// localhost / olapbin / msblah.dll 

这在文件系统中运行正常,但现在在IIS7 Web服务器上运行。 >

经过大量的crossdomain.xml文件的摆弄之后,我解决了这个问题:

 <?xml version =1.0?> 
<跨网域政策>
< 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的所有工作就好了。我得到:

 确定:已加载根级SWF:http://127.0.0.1/akts/ThinSlicerRunner.swf 
OK:接受的策略文件为:http://localhost/crossdomain.xml
OK:搜索< allow-access-from>在策略文件中,通过请求者http://127.0.0.1/akts/ThinSlicerRunner.swf
授权从http://localhost/olapbin/msmdpump.dll中的资源加载数据。确定:正在搜索< allow-http - 请求 - 报头-从大于;在政策文件授权标头发送到URL http://localhost/olapbin/msmdpump.dll由请求者从http://127.0.0.1/akts/ThinSlicerRunner.swf
确定:请求资源http://由于http://localhost/crossdomain.xml中的策略文件,允许来自http://127.0.0.1/akts/ThinSlicerRunner.swf的请求者使用localhost / olapbin / msmdpump.dll。

在Chrome和Firefox上,我只会得到:

  OK:加载根级SWF:http://localhost/akts/ThinSlicerRunner.swf 
OK:接受策略文件:http://localhost/crossdomain.xml

而没有别的...没有尝试授权httpservice请求。



在主flex错误日志我得到:

$ p $ ***安全沙箱违例***
连接到
http: //localhost/olapbin/msmdpump.dll
暂停 - 不允许从http://localhost/akts/ThinSlicerRunner.swf

哪个不会出现whe我从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);

连接对象亮点:

 
//初始化查询服务器所需的服务对象

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;

$ / code>

感谢您的帮助...希望这可以帮助别人解决问题。 ; - )



Shaun

解决方案

感谢大家的回答。这确实能够在代码
中解决,即使它不是真正的编码问题。



这是我正在阅读的xml数据文件配置细节来自:

 < tsConnection> 
< dataSource> megan< / dataSource>
< database> Adventure Works DW 2008< / database>
< cube> Adventure Works< / cube>
< xmlaUrl><![CDATA [
http://localhost/olapbin/msmdpump.dll
]]>< / xmlaUrl>
< / tsConnection>

现在在localTrusted或localWithNetworking设置中,这工作得很好。
它也适用于IE8的Flash播放器,即使在远程。



然而,发生了什么是xmlaUrl被读为:

  \\\
\rhttp://localhost/olapbin/msmdpump.dll
pre>

(以换行符和回车开始)
这是什么混淆域检查和抛出沙箱违例
时运行在远程安全沙箱中。

当然,我的xml本来应该是比较好的了,也许在编码时忽略一些白色的
空间处理,但在Netscape兼容的浏览器(10.1.x)中,仍然存在一些奇怪的,不一致的
行为。
因此,最终的工作解决方案看起来像这样:

 < tsConnection> 
< dataSource> megan< / dataSource>
< database> Adventure Works DW 2008< / database>
< cube> Adventure Works< / cube>
< xmlaUrl><![CDATA [http://localhost/olapbin/msmdpump.dll]]>< / xmlaUrl>
< / tsConnection>

虽然我确实成为了crossdomain.xml专家。 ;-)
虽然现在我根本不需要这个文件。

请记住,如果你看到一些疯狂的不明原因的沙盒违例,请检查
您的服务网址中的空白空间。


I've spent quite a bit of time on this so here's where I'm stuck.

I'm using the debug player 10.1 to get an XMLA request from:

http://localhost/dir/blah.swf

to:

http://localhost/olapbin/msblah.dll

This worked fine in the filesystem, but now its on an IIS7 web server.

After a lot of fiddling with the crossdomain.xml file I settled on:

<?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>

which is placed in:

http://localhost/crossdomain.xml

and read with:

Security.loadPolicyFile("http://localhost:80/crossdomain.xml");

I setup Policy file logging (which helped come up with the above file)and on IE8 its all working just fine. I get:

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

On Chrome and Firefox I just get:

OK: Root-level SWF loaded: http://localhost/akts/ThinSlicerRunner.swf
OK: Policy file accepted: http://localhost/crossdomain.xml

and nothing else... no attempts to authorize the httpservice requests.

In the main flex error log I get:

*** Security Sandbox Violation ***
Connection to
http://localhost/olapbin/msmdpump.dll
  halted - not permitted from http://localhost/akts/ThinSlicerRunner.swf

Which doesn't appear when I run the same thing from IE8.Any idea what's going on ??

AS REQUESTED... MORE CODE

Main sending request:

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);

Connection object highlights:

   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;
}

Thanks for your help ... hope this helps others when fixed. ;-)

Shaunhttp://www.vidgridz.com/

解决方案

Thanks for everyone's answers. It was indeed able to be solved in the codeeven if it wasn't exactly a true coding problem.

Here is the xml data file I was reading the configuration details from:

<tsConnection>
<dataSource>megan</dataSource>
<database>Adventure Works DW 2008</database>
<cube>Adventure Works</cube>
<xmlaUrl><![CDATA[
http://localhost/olapbin/msmdpump.dll
 ]]></xmlaUrl>
</tsConnection>

Now on the "localTrusted" or "localWithNetworking" setup, this was working just fine.It also works on the IE8 Flash player even in "remote".

However, what was happening was that the xmlaUrl was being read as:

\n\rhttp://localhost/olapbin/msmdpump.dll

(with the newline and carriage return at the start)This is was what was confusing the domain checking and throwing a Sandbox Violationwhen run in the "remote" security sandbox.

Of course, my xml should have been better, and maybe put in some ignore whitespace processing in the code, but still its quite some bizarre, inconsistentbehavior from the Flash player code in Netscape compatible browsers (10.1.x).

So the final, working solution looks like this:

<tsConnection>
<dataSource>megan</dataSource>
<database>Adventure Works DW 2008</database>
<cube>Adventure Works</cube>
<xmlaUrl><![CDATA[http://localhost/olapbin/msmdpump.dll]]></xmlaUrl>
</tsConnection>

I did become a crossdomain.xml expert in the process though. ;-)Although, now I don't need the file at all.

Bear it in mind if you see some crazy unexplained Sandbox Violations, check forwhite space in your service url.

这篇关于在Chrome / Firefox中Flex crossdomain.xml无法正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 13:34