1

I've got a wcf Service which has a method which send its output in jsonformat. The service is hosted in an https-Environment.

i'm calling it with angularjs-resource:

var hrdemo = angular.module('hrdemo', ["ngResource"]);

hrdemo.controller('HrDemoCtrl', function ($scope, hrdbservice) {
    $scope.items = hrdbservice.get({ 'Id': 1 });
    var a = $scope.items.length;
});

hrdemo.factory('hrdbservice', function ($resource) {
    return $resource('http://hrservice/HrService.svc/:Id', { Id: "@Id" }, { get: { method: 'JSONP' } });
});

Angularjs runs in an ASP.Net-Web Application. When calling the Service I get something like an xhr-problem.

1) How can i authenticate with my Windows authentication over angularjs 2) What can I do to fix the xhr-problem?

12

1 Answer 1

2

May the withCredentials option is what you are searching for $http.post(url, {withCredentials: true, ...}). Also there is a specific shortcut for performing a JSONP request in AngularJS - $http.jsonp()

AngularJS Docs

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.