locked
ajax web service call access denied RRS feed

  • Question

  • User1593233503 posted

    Hi,

    I am calling a webservice(.asmx) by AJAX from a HTML page. It works fine locally but when deplpoyed to servers I am getting Access denied in web service call. The HTML and the services are in different servers, different domain. 

    Can someone please help me in fixing the issue? 

    function GetConfig(ConfigKey) {
        alert('In the method GetConfig');
        var returnvalue = 0
        $.support.cors = true;
        $.ajax({
            url:'http://MyWebService.asmx/Getvalues',
            type: 'GET',
            data: { ConfigrationKey: ConfigKey },
            async: false,
            contentType: "application/json; charset=utf-8",
            success: function (data) {
                returnvalue = parseInt(data.documentElement.textContent);
                alert('success' + returnvalue);
            },
            error: function (xhr, status, error) {
                alert("Service Call not successful!" + error);
                returnvalue = 0;
            }
        });
        return returnvalue
    }

    Wednesday, September 16, 2015 9:40 AM

Answers

All replies