ajaxweb-services

Why does my web service call fail when calling a different site


I am making a JQuery ajax call to a web service like so:

    $.ajax({
        type: "POST",
        url: "https://WebsiteName.com/Service.asmx/LoginExternal",
        data: "{loginData: " + JSON.stringify(LoginData) + "}",
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
            ... Stuff ...
        },
        error: {
            ... Error Alert ...
        }
    });

When I am on the actual web site, this succeeds. When I am on localhost and use a relative path, it succeeds. However, when I am trying to access the web site (using an absolute path) from localhost, I get the error message that the call failed.

This would seem to indicate that it is a permissions problem and I've made sure that the web.config doesn't require authentication for access to the web service but I'm not sure what else to check. Any help would be greatly appreciated!

Update: The "thrownError" that I am getting is "No Transport" - hopefully that helps.


Solution

  • Security:

    http://en.wikipedia.org/wiki/Same_origin_policy