访问Intranet服务时xhr错误0x2efd [英] Error 0x2efd from xhr when accessing intranet services

查看:96
本文介绍了访问Intranet服务时xhr错误0x2efd的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个应用程序,可以调用RESTful使用WinJS.xhr和应用程序中其他地方的Intranet上的服务将Intranet内容加载到iframe中。 不幸的是,
服务调用和iframe内容加载都失败了。我在.appxmanifest文件中声明了以下功能:

I have an app that makes calls to RESTful services on the intranet using WinJS.xhr and elsewhere in the app it loads intranet content into an iframe.  Unfortunately, the service calls and the iframe content load both fail. I do have the following capabilities declared in the .appxmanifest file:

    < Capability Name =" privateNetworkClientServer" />
$
    < Capability Name =" internetClient" />

    <Capability Name="privateNetworkClientServer" />
    <Capability Name="internetClient" />

此外,我在IE
中的可信站点区域中拥有服务主机和内容主机的网站(我已添加了 通过主机名和FQDN(例如 http:// servername
http://servername.company.com)

Additionally, I have the sites of the service host and the content host in the Trusted Sites zone in IE (I have added them by both host name and FQDN (e.g. http://servername and http://servername.company.com).

如果我打开Metro IE并输入服务的URL或内容页面在地址栏中,他们正确解析并按预期显示,但如果我在"受信任的站点"区域中有网站,则仅限
。但是,尝试在iframe中加载内容页面
(例如document.getElementById(" contentIFrame")。s​​rc =" http ://server.company.com/path/page.aspx ";)
失败,没有明显错误.xhr调用  (到端点)例如  http:/ /server.company.com/path/morePath/GetMyData/someValue
  因0x2efd错误而失败。  注意:我还使用了http:// server /< path>同样失败(而不是FQDN)并且它同样失败。

If I open Metro IE and put in the URL of the service or a content page in the address bar, they resolve correctly and display as expected, but only if I have the sites in the Trusted Sites zone.  However, attempting to load a content page in the iframe (e.g. document.getElementById("contentIFrame").src = "http://server.company.com/path/page.aspx";) fails with no visible error. The xhr calls (to an endpoint such as http://server.company.com/path/morePath/GetMyData/someValue  ) fail with the 0x2efd error.   Note: I have also used just http://server/<path> as well (instead of FQDN) and it fails equally.

这就是问题:如果让Fiddler运行,xhr会调用execute并成功加载iframe内容。  我不是很清楚为什么会这样。 

Here's the rub: If have Fiddler running, the xhr calls execute and the iframe content loads successfully.   I'm not quite clear why this is so. 

我在这个论坛和其他人上做了很多搜索,但没有找到解决这个问题的任何内容。 我最接近的是需要添加
privateNetworkClientServer 功能,但我已经宣布了该功能。  xhr调用是从页面(而不是iframe)执行的,所以基于我的理解
(参见
这一点在上下文中
),
如果功能声明到位且CORS不是问题,它们应该可以工作。   

I've done quite a bit of searching on this forum and others, but not yet found anything to address this issue.  The closest I've seen is that the privateNetworkClientServer capability needs added, but I already have that capability declared.  The xhr calls are executed from the page (not the iframe), so based on my understanding (see this bit on context), they should work provided the capability declarations are in place and CORS is not an issue.   

我还错过了需要翻转的其他位吗?

Are there additional bits that need flipped that I've missed?

 

如果他们帮助你,请记得将回复标记为答案。

Please remember to mark replies as answers if they help you.

推荐答案

Nino,

这是一个面向公众的服务器吗?我可以从这里点击?

Is this a public facing server I could hit from here?

-Jeff


这篇关于访问Intranet服务时xhr错误0x2efd的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆