on 11-18-2014 6:46 PM
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
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.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.