Skip to Content
0
Former Member
Jul 15, 2015 at 02:53 PM

Want to Access Web Service from different domain server to local host in SAP UI5

208 Views

Hi,

I am facing one issue regarding Accessing different domain OData web service. in SAP UI5.

Currently what i am doing is shown below :

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

var aData = jQuery.ajax({

type : "GET",

contentType : "application/json",

url : "http://domain name:port name/sap/opu/odata/SAP/ZR_SRV/YR_CODESet",

dataType : "jsonp",

success : function(data,textStatus, jqXHR) {

oModel.setData({modelData : data});

alert("success to post");

}

});

But i am getting below mentioned error:

XMLHttpRequest cannot load http://domain name::8006/sap/opu/odata/SAP/ZR_SRV/YR_CODESet()?$format=json. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:56167' is therefore not allowed access. The response had HTTP status code 405.

sap-ui-core.js:80 2015-07-15 20:15:14 The following problem occurred: HTTP request failed0,, -

Please provide me some helpful solution for that as i am stuck in very urgent deliverable assignment.Helpful answere will be rewarded.

Thanks,

Vinay Sharma