cancel
Showing results for 
Search instead for 
Did you mean: 

Uploading Video to SAP Gateway

stefan_heitzer
Participant
0 Kudos

Hello everybody,

I'm currently having an issue with uploading files via SAP Netweaver Gateway.

What I'm trying to do is to capture a video and sending it to SAP Gateway. I'm coding in JAVA and I'm using the odata4j-Framework for consuming and producing OData. My current tries involved to encode the video to a base64-String and sending the string to the gateway... The encoding of the video works quite fine but the prolbem is that the string is really veeeeeeeeery huge ... Everytime when I'm trying to make the request I receive a "OutOfMemoryException".

Is there actually a way with which I'm able to send a video file with odata4j to the SAP Netweaver Gateway??? I'm really looking forward to your help!!!

Greetings

Stefan

Accepted Solutions (0)

Answers (4)

Answers (4)

stefan_heitzer
Participant
0 Kudos

Hi,

here's a short news update... I still haven't found a solution for sending the video to the gateway ... maybe someone knows something?

Greetings

AshwinDutt
Active Contributor
0 Kudos

Hello Stefan,

Please follow and check as below.

In Gateway Level,

Create an Entity with all the required parameters. Set that entity as Media Type.

Use Edm.Binary as the type in GW Level for the field which will hold your media content value.


Redefine Create_Stream method in DPC_EXT class.

Read the Content Value and Mime Type value.

Read the Key value sent as part of ' slug '.

Implement the logic and use the above values to appropriately save the media content in back-end.


You can fire the service as below -> Sample one


Send the Token Value and the Key as part of ' slug ' header.

In your case, send the Content-Type as video/mp4

This way you should be able to upload.

Regards,

Ashwin

stefan_heitzer
Participant
0 Kudos

Hi Ashwin,

yeah these were exactly the steps I did but the problem is how to call the service from the frontend? odata4j (consumers) do not support the use of media link extensions as far as I know...Going to try to send the vid in various parts today....

Greetings

AshwinDutt
Active Contributor
0 Kudos

Hello Stefan,

I do not know how it can be done through odata4j. Sorry for that.

Regards,

Ashwin

stefan_heitzer
Participant
0 Kudos

Hi and thanks a lot for your quick replies! The questions which I have right now is how to send the video. I get it as a mp4 file and I'm using odata4j. The framework itself provides a methode "createEntity" with all the properties I declare in the GW. My guess is as I already mentioned that the string is too big --> I need to send the video directly, but how can I make this?

Looking forward to your answers!

Greetings

Stef

Former Member
0 Kudos

Hi Stef,

I'm not a java developer but looking at odata4j methods I don't think 'createEntity' supports media links.

I found media link references in the extension interface OMediaLinkExtension, if there is support for video, it will be here I think.

Regards

Ron.

stefan_heitzer
Participant
0 Kudos

Hi Ron,

thanks for the hint! I'm going to try this When I have a result I'm going to respond!

Greetings!

AshwinDutt
Active Contributor
0 Kudos

Hello Stefan,

Set your entity as Media Type.

You need not to convert to any type of string format and send to GW.

All you need to do is attach the files in GW Client and fire the service which will intern call Create_Stream method.

Inside this method you need to write the logic which will save your files in the appropriate format in back-end.

Regards,

Ashwin

SyambabuAllu
Contributor
0 Kudos

Hi Stefan,

Even I also facing the same issue with data size limit while uploading MP4 files..We can expect answers from GW Experts.

Thanks,

Syam

stefan_heitzer
Participant
0 Kudos

Hi Syam,

well the issue seems to appear when trying to set the base64 string as a property value for the odata entry... my guess is that the encoded string is way too long and so the application is running out of memory ...

Maybe somebody has already handled this issue and could give us the solution

Greetings

Stef

Former Member
0 Kudos

Hi Stef,

Your problem is that you are assigning the content as a property of an entity. Video is "media stream" content so you have to use the streaming functions of the framework. Your entity properties should contain the key and metadata of the content, but the actual content is treated as the entity 'value' and is not a property. 

Streaming applies to any "file" content, and since your video is a binary file you can use the same techniques as outlined in some of the articles in this space.

Cheers

Ron.