locked
ERROR :SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd. File: default.html RRS feed

  • Question

  • Hi ,all

    I am beginner for windows 8 app development.

    I created simple project on domain name called www.aaa.com and also hosted web services on same domain. at that time i was able to access web services on my application code using AJAX. Then i created same project on another domain called www.bbb.com then i tried to access wcf services from www.aaa.com domain. at that time my javaScript console is throwing this error "SCRIPT7002: XMLHttpRequest: Network Error 0x2efd, Could not complete the operation due to error 00002efd.
    File: default.html". I tried some thing on both end on web services project as well as windows 8 app.

    AT app side in package.appxmanifest file i added below code.

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

    AT web services side in web.config file i added following settings.

    <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
            multipleSiteBindingsEnabled="true" />

        <standardEndpoints>
          <webScriptEndpoint>
            <standardEndpoint name="" crossDomainScriptAccessEnabled="true" />
          </webScriptEndpoint>
        </standardEndpoints>

    but above all diagnostics are not working for me.

    and one more thing at www.bbb.com domain in sample android app while i am trying to consume my wcf services it is working fine. the problem is specifically for windows 8 app only.

    Here is sample code which i had written in default.html file

    <!DOCTYPE html>
    <html>
    <head>
        <meta charset="utf-8" />
        <title>DemoWebService</title>
    
        <!-- DemoWebService references -->
        <script src="/js/default.js"></script>
        
    
    
        <script>
    
            var personNameVar = "Hardik";
            var dataIn = '{' + '"personName":"' + personNameVar + '"}';
            $.ajax({
                url: "http://SomeIP:SomePort/Service1.svc/HelloWorld",
                type: "POST",
                contentType: "application/json; charset=utf-8",
                data: dataIn,
                dataType: "json",
                success: function (data) {
                    var object = JSON.parse(data.d);
                    
                    if (object.Error == '') {
                        $('body').html(object.Response);
                    }
                },
                error: function (error) {
                    $('body').html(error);
                }
            });
    
    
           
    </script>
    
    </head>
    <body>
        
    </body>
    </html>
    

    so is there any help. I am eagerly waiting for it.

    P.S I am accessing www.aaa.com web services using VPN.

    Thanks in advance,

    Hardik

    Friday, January 16, 2015 7:27 AM

Answers

  • In that case, I recommend that you collect a Network trace using a tool such as Microsoft Network Monitor or Wireshark to understand what IP Address is the connection being made to. The 0x2efd error correlates to the WinINet error: ERROR_INTERNET_CANNOT_CONNECT meaning that the connection with the remote server cannot be established. When you collect a network trace, try looking for the TCP-SYN signal and see whether your remote server responds with a SYN-ACK.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, January 20, 2015 11:23 PM
    Moderator

All replies

  • Can you access that same URL from Internet Explorer?

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Friday, January 16, 2015 5:49 PM
    Moderator
  • Yes, definitely i am able to access the same URL from IE. even i can access that URL from IE of simulator also.
    Monday, January 19, 2015 5:28 AM
  • In that case, I recommend that you collect a Network trace using a tool such as Microsoft Network Monitor or Wireshark to understand what IP Address is the connection being made to. The 0x2efd error correlates to the WinINet error: ERROR_INTERNET_CANNOT_CONNECT meaning that the connection with the remote server cannot be established. When you collect a network trace, try looking for the TCP-SYN signal and see whether your remote server responds with a SYN-ACK.

    Windows Store Developer Solutions, follow us on Twitter: @WSDevSol|| Want more solutions? See our blog

    Tuesday, January 20, 2015 11:23 PM
    Moderator