I'm creating an application using phonegap + onsen framework that will be powered by Web Services (RestFul).
But I can not make a conversation between the two parties.
My call to the Web Service looks like this:
$http.get('http://localhost:8080/WhereToJamServer/ws/colacao/getDataAtual', {})
.success(function(data) {
alert(data);
})
.error(function() {
alert('error');
});
And my Web Service looks like this:
@Path("/colacao")
@GET
@Path("getDataAtual")
@Produces(MediaType.TEXT_HTML)
public String getDataAtual() {
SimpleDateFormat sdf = new SimpleDateFormat("dd-MM-yyyy");
return sdf.format(new Date());
}
If I change localhost to 10.0.2.2 or the local IP (IPv4) of my machine does not work either.
NOTE: When I call the URL through the browser it works normally.
Any suggestions?