﻿
//Call the WCF Service
function ServiceCall(proxy, parametersAsJSONObject, successCallback) {

    jQuery.ajax({ type: "POST",
        contentType: "application/json; charset=utf-8",
        url: proxy,
        data: JSON.stringify(parametersAsJSONObject),
        dataType: "json",
        error: function(XMLHttpRequest, textStatus, errorThrown) {
            ServiceCallError(XMLHttpRequest, textStatus, errorThrown);
        },
        success: successCallback
    });
}

//WCF Service error
function ServiceCallError(XMLHttpRequest, textStatus, errorThrown) {
    alert("Sorry, we are unable to load the data you requested at this time.");
    //alert(XMLHttpRequest);
    //alert(textStatus);
    //alert(errorThrown);
}