locked
call .svc rest service RRS feed

  • Question

  • User-1803226828 posted

    how to call .svc rest service in asp.net .ajex method

    http://svc.middleeasthotel.com/Service.svc/CurrencyConvert?From=USD&To=INR&Amount=1

    not call that service in bellow code getting some error

    $.ajax({
            type: 'GET',
            url: wsUrl,
            contentType: "application/json, charset=utf-8",
            dataType: "json",
            success: function (data) {
            alert(data.d);
    },
    error: function (e) {
            alert(e.message);
    }

    Saturday, December 27, 2014 2:02 AM

Answers

  • User-1803226828 posted

    $.ajax({
    type: 'GET',
    url: wsUrl,
    contentType: "text/plain, charset=utf-8",
    dataType: "json",
    success: function (data) {
    alert(data.Value);
    },
    error: function (XMLHttpRequest, textStatus, errorThrown) {
    alert(textStatus + "," + errorThrown.toString());
    }
    });

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, December 27, 2014 2:21 AM