Hello I have a doubt how to return JSON as resopnse in webservices in Java JAX-WS for integration with AngularJS
If it possible any way please comment while we are working with Angular and we services as part of response how we set JSON as response.
If you are working with .NET web services it has direct support to call the function in service
var myApp = angular.module("myModule", []).controller("myController", function ($scope, $http) {
$http.get('EmployeeServices.asmx/GetAllEmployee').then(function (response) {
$scope.employess = response.data;
});
});
How can we can call Java web sevice using AngularJS call?
Whether or not the web service is a Java service, .NET, or something else entirely is irrelevant. All that the $http service is doing is making an HTTP request (in this case a GET) to the given URL.
In the snippet you provided you're calling a .NET service, but you could just as easily have given a URL that points to a Java service. You say that you're expecting a JSON response, so as long as the URL that you give points to your service which returns valid JSON, your service can be Java, .NET, etc.