Flex - HTTPService - 访问 YouTube api 时出现安全错误
我定义了以下 HTTPService:
<mx:HTTPService id="youTubeHttpService" result="resultHandler(event)" fault="faultHandler(event)"/>
我使用以下 URL(模式)来获取特定用户的 YouTube 视频列表:
http://gdata.youtube.com/feeds/api/users/Y/uploads
其中 Y 是 YouTube 上的注册用户。
例如:http://gdata.youtube.com/feeds/api/users/YouTube /uploads
我使用以下语法发送 HTTP 请求:
youTubeHttpService.url = "http://gdata.youtube.com/feeds/api/users/YouTube/uploads";
youTubeHttpService.resultFormat = "object";
youTubeHttpService.send();
现在,上面的代码对于使用我们软件的某些人来说工作正常,而其他人则遇到以下错误(在 failureHandler() 中):
Error: [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
再次,错误发生在某些人,而不是其他人。
我错过了什么吗?这是机器/浏览器特定的问题吗?作为健全性检查,上述代码适用于 chrome(即 firefox 和 safari)中的相同 .swf 文件。
我已阅读有关 crossdomain.xml 的内容,但不认为这是问题,因为 YouTube 已对此进行了定义。
最后,所有用户(内网应用程序)都使用IE和相同版本的flash。
任何帮助将不胜感激,因为我在过去的两天里一直在烦恼并一遍又一遍地问这个问题“为什么只发生在某些用户身上而不发生在其他用户身上?”
规范。
I have the following HTTPService defined:
<mx:HTTPService id="youTubeHttpService" result="resultHandler(event)" fault="faultHandler(event)"/>
And I'm using the following URL (pattern) to obtain a list of YouTube videos for a particular user:
http://gdata.youtube.com/feeds/api/users/Y/uploads
where Y is a registered user on YouTube.
Eg: http://gdata.youtube.com/feeds/api/users/YouTube/uploads
I send an HTTP request using the following syntax:
youTubeHttpService.url = "http://gdata.youtube.com/feeds/api/users/YouTube/uploads";
youTubeHttpService.resultFormat = "object";
youTubeHttpService.send();
Now, the above code works fine for some people using our software while others are experiencing the following error ( in faultHandler() ):
Error: [RPC Fault faultString="Security error accessing url" faultCode="Channel.Security.Error" faultDetail="Destination: DefaultHTTP"]
Again, the error happens to some people and not for others.
Have I missed something? Would it be a machine / browser specific problem? As a sanity check the above code works with the same .swf file in chrome, ie, firefox and safari.
I have read about the crossdomain.xml and don't think that is the issue as YouTube have that defined.
Finally, all users (intranet app) are using IE and the same version of flash.
Any help would be greatly appreciated as I have been pulling my hair out the past 2 days and asking the question over and over again "Why is it only happening for some users and not for other users?"
Norm.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
有没有可能他们的安全设置太高了?查看此页面以更改它们 http://www.macromedia。 com/support/documentation/en/flashplayer/help/settings_manager04.html
Could it be possible that they have their security settings too high? Check out this page to change them http://www.macromedia.com/support/documentation/en/flashplayer/help/settings_manager04.html
您有跨域策略限制
http://gdata.youtube.com/crossdomain.xml
看起来就像 youTube 几乎允许一切。
所以这让我相信该文件没有被加载。
尝试这个或它的一种形式。
还可以使用 FireFox 的 HTTPFox 插件来查看它是否被加载
如果情况变得更糟试试这个
You have a crossdomain policy restriction
http://gdata.youtube.com/crossdomain.xml
It looks like youTube is allowing pretty much most everything.
So that leads me to believe the file is not being loaded.
Try this or a form of it.
Also Use HTTPFox plugin for FireFox to see if it gets loaded
If worse comes to worse try this