on 05-29-2018 2:04 PM
UI5 App deployed on local apache server. An Odata call is made in the onInit method. As soon as the service gets called, an authentication popup is created for the HANA system. The issue is that the application URL in the browser gets replaced with the actual XSODATA service URL after entering the username and password. Ideally the UI5 page should be called again after the authentication, but the URL in the browser stays at the XSOdata metadata.
UI5 Code :
var url = "https://abcde.xsodata/";
var oModel=new sap.ui.model.odata.ODataModel(url,true); oModel.read("/entitysetname(1)", null, {},false, function(data){ console.log(data) },function(error){ console.log(error) });
XSOData code( In the xsaccess file) :
{
"exposed" : true,
"authentication" :
{
"method": "Basic"
},
"cache_control" : "must-revalidate",
"xhrFields" : { "withCredentials" : true},
"cors" :
{
"enabled" : false
},
"enable_etags" : false,
"force_ssl" : false,
"prevent_xsrf" : false
}
Would be grateful if someone could help out with the redirection issue.
why not model declaration in config file?
not sure, try request using proxy once
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
Why you are not using OData model v2?
var oModel = new sap.ui.model.odata.v2.ODataModel(URL);
oModel.read("/InfoSet",{
success: function (oData){
//success
},
error : function(oEvent){
//...
}
});
Check it here
Hope this can help you.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.