Hi All,
I,m trying to read data from SAP AS java system.
var formModel = sap.ui.model.odata.ODataModel("proxy/http/XXXXXXXXXXXXX/service", "username", "pwd");
var path = "/mycollection?$expand=abc&$format=json";
formModel.read(path,auth,true, function(oData, oResponse){
console.log(oData);
},function(){
alert("Read Unsuccessful");
});
i tried using above code but its working fine and showing 200 statusCode but the problem is empty object even though i have data.
for more information PFA.
so any suggestions.
Thanks & Regards
Venkat.
Hello,
Finally my issue is solved i used AJAX call to get data and here is my code
$.ajax({
url : "proxy/http/XXXXXXurl?$expand=abcollection&$format=json",
type: "GET", //or POST?
dataType: "json",
xhrFields:
{
withCredentials: true
},
beforeSend: function (request)
{
request.setRequestHeader('Authorization', 'Basic ' + btoa('username:password'));
},
success: function(odata,oresponse){
debugger;alert("ok")
}
});
Regards
Venkat
Hi Venkat,
If you look closely at your screenshot it indicates that the model has an invalid metadata document. It would seem that the metadata on the back end service needs to be updated and then maybe you can try again.
Regards,
Ryan Crosby
Add a comment