This question is locked. New answers and comments are not allowed.
Hi All
Ho do i consume data from a web service in a different domain ? I have tried the dataSource approach (http://www.kendoui.com/forums/framework/data-source/authenticating-to-a-data-source.aspx) but this appears to be a no good for me.
cross domain requires Jsonp for which I cannot set headers for authentication.
Cors has been enabled on the server, and i can see the headers come back. I have tried the following:
var url = 'XXX web service url';
url = url + '?enable_cors_headers=true&enable_http_auth=true';
var req = new XMLHttpRequest();
req.onload = function() { console.log(this.responseText); };
req.open('get', url, true);
req.setRequestHeader('Accept', 'application/json');
req.setRequestHeader('Authorization', 'Basic 6b1be1a046ff19e26683572ac5a7d07e');
//also tried the following with correct username and password
//req.setRequestHeader('Authorization', 'Basic username:password');
req.send();
Icenium debuger console just shows 401 error no matter what i try
Add the web service in a browser, and it comes and asks for credentials, add them in and its fine
How do other people access a secured web service in icenium ???
I can get it working in eclipse, but i want to build across platform, and want to use icenium, I just cant find out how.
Thanks
Luke
Ho do i consume data from a web service in a different domain ? I have tried the dataSource approach (http://www.kendoui.com/forums/framework/data-source/authenticating-to-a-data-source.aspx) but this appears to be a no good for me.
cross domain requires Jsonp for which I cannot set headers for authentication.
Cors has been enabled on the server, and i can see the headers come back. I have tried the following:
var url = 'XXX web service url';
url = url + '?enable_cors_headers=true&enable_http_auth=true';
var req = new XMLHttpRequest();
req.onload = function() { console.log(this.responseText); };
req.open('get', url, true);
req.setRequestHeader('Accept', 'application/json');
req.setRequestHeader('Authorization', 'Basic 6b1be1a046ff19e26683572ac5a7d07e');
//also tried the following with correct username and password
//req.setRequestHeader('Authorization', 'Basic username:password');
req.send();
Icenium debuger console just shows 401 error no matter what i try
Add the web service in a browser, and it comes and asks for credentials, add them in and its fine
How do other people access a secured web service in icenium ???
I can get it working in eclipse, but i want to build across platform, and want to use icenium, I just cant find out how.
Thanks
Luke