cancel
Showing results for 
Search instead for 
Did you mean: 

CROSS ORIGIN ISSUE - Improper oData URL format

Former Member
0 Kudos

I am using proxy Servlet(attached below) and one handler(attached below) to resolve Cross origin issue.

Below is the code fragment I am using. But Its giving unexpected oData Url format due to which getting 404 error while reading the entity.

var loginId= sap.ui.getCore().byId("__xmlview0--loginId");

//its giving Entity set

var oModel = new sap.ui.model.odata.ODataModel("http://PO server:port num/MyApp/GWProxyServlet?sap/opu/odata/SAP/ZFK_ORD_HEADERDETAILS_SRV/");

//i am reading perticular entity

oModel.read("/EmployeeSet(empid='"+id+"')", null, null, false, function(oData){

oLoginJsonModel.setData(oData);

// In console unexpected URL format as below

http://PO server:port num/MyApp/GWProxyServlet?EmployeeSet(empid='"+id+"'sap/opu/odata/SAP/ZFK_ORD_HEADERDETAILS_SRV/"

Please suggest on this.

Accepted Solutions (0)

Answers (4)

Answers (4)

SergioG_TX
Active Contributor
0 Kudos

try "/EmployeSet("+id.toString()+")" // without empid= inside the parenthesis

seVladimirs
Active Contributor
0 Kudos

wierd, that you have such an error in Console. Try to escape your path, e.g.


var sURI = "/EmployeeSet(empid='"+id+"')";

var sPath = escape(sURI);

oModel.read(sPath, null, null, false, function(oData){

...

});

Former Member
0 Kudos

its not work Vladimirs Semikins

Former Member
0 Kudos

its not catch issue i check it.

karthikarjun
Active Contributor
0 Kudos

Hi Mohd,

It could be a catch issue.

Thanks,

KA