Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/search/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows runtime webview中的WinJS网页在使用cors的ajax调用中返回0x80070005_Windows Runtime_Windows 8.1_Winjs - Fatal编程技术网

Windows runtime webview中的WinJS网页在使用cors的ajax调用中返回0x80070005

Windows runtime webview中的WinJS网页在使用cors的ajax调用中返回0x80070005,windows-runtime,windows-8.1,winjs,Windows Runtime,Windows 8.1,Winjs,我们有一个WinJS应用程序,它在WebView控件中显示一个网站,网页加载良好,但是每次ajax调用都会失败,出现0x80070005访问被拒绝错误。我们尝试在应用程序中添加“Internet(客户端)”、“Internet(客户端/服务器)”和“专用网络”功能,但没有成功 调用使用CORS来允许调用多个域,该站点在每个桌面浏览器上运行良好,甚至在现代环境中的IE上也是如此。但是,当站点在WebView控件内运行时,只有飞行前请求才会运行,尽管服务器正在响应状态代码为200的请求,但不会发送真

我们有一个WinJS应用程序,它在WebView控件中显示一个网站,网页加载良好,但是每次ajax调用都会失败,出现0x80070005访问被拒绝错误。我们尝试在应用程序中添加“Internet(客户端)”、“Internet(客户端/服务器)”和“专用网络”功能,但没有成功

调用使用CORS来允许调用多个域,该站点在每个桌面浏览器上运行良好,甚至在现代环境中的IE上也是如此。但是,当站点在WebView控件内运行时,只有飞行前请求才会运行,尽管服务器正在响应状态代码为200的请求,但不会发送真正的请求

我们可以通过Fiddler看到这一点,这是飞行前的请求:

OPTIONS /Queries/QueryContentAreas/GetAvaliableContentAreas HTTP/1.1
Accept: */*
Origin: https://myapp.demo.es
Access-Control-Request-Method: GET
Access-Control-Request-Headers: accept, authorization
UA-CPU: AMD64
Accept-Encoding: gzip, deflate
User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; Trident/7.0; MSAppHost/2.0; rv:11.0) like Gecko
Host: myappapi.demo.es
Content-Length: 0
Connection: Keep-Alive
Cache-Control: no-cache
下面是服务器的响应:

HTTP/1.1 200 OK
Server: Microsoft-IIS/8.0
Access-Control-Allow-Origin: https://myapp.demo.es
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: authorization
X-Powered-By: ASP.NET
Date: Thu, 29 May 2014 16:32:56 GMT
Content-Length: 0
在Visual Studio中,出现此拒绝访问错误:

SCRIPT7002: XMLHttpRequest: Error de red 0x80070005, Acceso denegado.
File: demo

我不知道你是否知道这一点,但我遇到了类似的事情

基于此,似乎由于应用程序位于web上下文中(因为它位于web视图中),所以不允许跨域XHR请求