Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

No 'Access-Control-Allow-Origin' header is present

Hi All,

         I am doing an AZAX call to AS400 Service From SAP UI5.

I am getting error :

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:55756' is therefore not allowed access. The response had HTTP status code 400.

But if i disable web security for chrome using command.

Same service works fine.

Kindly suggest. How we can call this service without disable web security.

AJAX Source Code :


                             type : "GET",

                             contentType : 'application/json',

                             dataType : 'json',

                             crossDomain : true,

                             url : url,

                             headers: {

                            'api-key' : 'XXXXX',

                                 userId : 'XXXX',

                              password : 'XXX',

                              'Access-Control-Allow-Origin' : '*',




                          success : function(response, status, request)





                                  var oModel = new sap.ui.model.json.JSONModel(response.LookupResponse.Rows);




                             error : function(jqXHR, textStatus,errorThrown)


                                    alert(" No success");





Helpful Answer

Not what you were looking for? View more on this topic or Ask a question