Skip to Content
-1

Consuming XSodata in SAP UI5

Dear Experts,

Created Xsodata and its working fine. But while consuming the XSodata in UI5 . In controller passed the XSodata url and trying to retrieve the odata values in UI5.

Its getting Uncaught in promise error in browser console.

Please let me know your comments.

Thanks,

Ravi

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

2 Answers

  • Jan 31 at 08:59 AM

    Hi! Please share some code from your controller.

    Add comment
    10|10000 characters needed characters exceeded

  • Jan 31 at 09:15 AM

    Hi Efim could you please provide us some code or a jsfiddle link?

    To consume xsodata you have to bind that service to an OData Model.

    var oModel = models.createODataModel("./service/service.xsodata", {
    	json: true,
    	useBatch: false,
    	refreshAfterChange: true,
    	headers: {
    		"X-Requested-With": "X",
    		"Content-Type": "application/json",
    		"sap-client": "209"
    	}
    	
    });
    this.setModel(oModel, "oDataModel");

    After that you can use oDataModel inside your controller/view to bind it.

    Add comment
    10|10000 characters needed characters exceeded