I am stuck trying to read an image from the gateway.
If I run this uri directly in the SAP gateway it runs OK and the image data is read: /sap/opu/odata/sap/ZSA_USERS_SRV/UserPhotoSet('someone@gmail.com')/$value"
Now I want to read this image in my sapui5 application using the code below, but I just get the error "EventProvider sap.ui.model.odata.v2.ODataModel - No data was retrieved by service:"
What am I missing here?
var oModel = this.getOwnerComponent().getModel();
oModel.read("/UserPhotoSet('someone@gmail.com')/$value", {
success: function(oData, oResponse) {
alert("Success read userphotto");
img.setSrc(oData);
},
});