cancel
Showing results for 
Search instead for 
Did you mean: 

How to implement GET_ENTITYSET for Media Stream

chinna_babu2
Active Participant
0 Kudos

Hi Experts,

I have implemented GET_STREAM method to download the media entity. When I execute the service as /zservice/photo/$value media steam is getting downloaded.

I need to implement the GET_ENTITYSET method as well because this will be used in SMP Mobile and from mobile it will need to register the service by calling /zservice/photo. If this method is implemented its throwing "Invalid or no mapping to system data types found" error.

Please advise how to implement GET_ENTITYSET. Method doesn't need to return any results.


Regards,

Murthy

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member184515
Participant
0 Kudos

Hi Murthy,

Can you please suggest how you managed to achieved your requirement.

Thanks,

Laxman

chinna_babu2
Active Participant
0 Kudos

Hi Laxman,

I have unchecked the Media from Entity Set and returning the media content as RAW data.

Regards,

Murthy

former_member184515
Participant
0 Kudos

Hi Murthy,

Thanks for the prompt reply. Can you please share the code snippets.

Regards,

Laxman

0 Kudos

Hi

You can bind property "{__metadata/media_src}" - contain ../yourEntitySet/photo/$value.

data.results[n].yourData

                     .__metadata/media_src.

Example

sap.ui.Image({

     src: "{__metadata/media_src}"

});

OR

oButtonOpenFile = new sap.ui.commons.Button({

     text: "Open",

     customData: [{ key: "URL"

                            value: "{__metadata/media_src}"

                        }],

     press: function(e){  window.open(e.getSource().data("URL", "blank") }

});