WinJS.xhr: Network Error 0x2efd, Could not complete the operation due to error 00002efd
Asked Answered
J

3

9

I have problem with WinJS.xhr when developing a Windows 8 Metro application in JavaScript.

WinJS.xhr({ url: "http://www.seznam.cz"});

When above code is executed, I see in log:

SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete
the operation due to error 00002efd.

I have enabled "Internet (Client)" capability in manifest.

Maybe the problem is because I am behind proxy and using VPN, but I can access internet using Google Chrome (I just need to authorize, otherwise HTTP Status 407 - proxy authorization needed).

How can I fix it?

[EDIT] So I found that it is probably related to the VPN I have to use (Cisco VPN Client). When I disable the VPN, even when I am behind the proxy (I use the LAN, with VPN I use WiFi), the request works. Maybe it is only Cisco VPN related. I had to modify registry as it is described here http://verbalprocessor.com/2012/09/17/windows-8-and-cisco-vpn-client/

Also interesting is that a few Metro apps work (maps) and some do not work (windows store) when I am behind proxy.

Just a notice: I have explored Windows.Networking.Connectivity and in both cases (with/without VPN) I get NetworkConnectivityLevel == "Local Access" (because I am behind the proxy probably).

Judges answered 1/11, 2012 at 11:42 Comment(0)
D
16

I got the same error when connected to my workplace SSL/VPN connection (from Juniper).

Opening the .appxmanifest file and adding the "Private Networks (Home & Server)" capability solved the issue.

<Capabilities>
  <Capability Name="internetClient" />
  <Capability Name="privateNetworkClientServer" />
</Capabilities>
Derinna answered 6/2, 2013 at 18:38 Comment(2)
Thank you so much, I had been going crazy for 2 hours trying to figure out what this wasEtna
Worth noting that your ajax calls etc. will work fine on an unsigned app without the Private Networks (Client & Server) capability enabled. As soon as you sign your app with a certificate ready for deployment to a device you will need to enable it.Counterstamp
C
1

This solution worked for me (see forums link below)... essentially, you need to add the server's certificate to the Windows Store App manifest (also be sure your manfiest "Capabilities" are set to at least "InternetClient"). You can get the server's certificate by exporting it from your browser, save is as a ".der" file. Using Firefox was easier than IE in doing this (From FF, browse to the target domain that has the certificate, then right click on the page > Page Info > Security tab > Details tab > Export button > save as ".der".

http://social.msdn.microsoft.com/Forums/en-ZA/winappswithcsharp/thread/4a776e8c-0e10-4f03-908f-7f765d914080?prof=required

This solution seems absurd - so bear in mind, this may only be necessary for sites that are using self-signed certificates, like in a development environment, because this process was not necessary for other production sites.

Charterhouse answered 5/11, 2012 at 23:22 Comment(0)
T
0

The proper way to do this was posted on the MSDN forums, it didn't work for me but the following did


config.xml

...

<platform name="windows"> 
     <config-file target="package.appxmanifest"> 
         <DeviceCapability Name="privateNetworkClientServer" /> 
     </config-file>
     ...
 </platform> 

These will be merged with your other capabilities

Thier answered 20/4, 2016 at 21:26 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.