I have created a sample project where I am trying to hit a service which gives the Latitude and Longitude of a particular location. I have already deployed the adapter on the server and now I am trying to hit the adapter. When I try to do so, I get the error: WLResourceRequest is not defined in my js. Following is my code:
function locate() {
var locat = document.getElementById('location').value;
alert(locat);
var resourceRequest = new WLResourceRequest(
"/adapters/LocationAdapter/getGmapLatLng",
WLResourceRequest.GET
);
resourceRequest.setQueryParameter("params", "['110064']");
resourceRequest.send().then(
function(response) {
alert("Success\n\n" + response);
},
function(error) {
alert("Failure\n\n" + error);
}
)
}