cancel
Showing results for 
Search instead for 
Did you mean: 

Problem with sending base64 encoded values via Web-Service

mario_maisto
Participant
0 Kudos

Hello,

I was wondering maybe you guys can help solve a problem regarding with sending base 64 encoded messages via web-service.

As mentioned, I am trying to upload base 64 encoded messages to backend. In the frontend, the javascript encoder seems to be working just fine (I checked the encoded results with the result of one of the online encoders. The result was the same. So - the file gets correctly encoded.)

But when I check the result received with the web-service, then the import parameter is faulty with only having about 1/4 of the correct code and the rest is something else. Maybe it has something to do with the type 'string' I am using (not long enough?) ?

Here's some graphical examples :

1. The encoded (and correct result from javascript, NOTE :  the red mark illustrates the point where something goes wrong in the web-service result) :

2. The faulty result I got in the debugger mode :

Hope you can help,
Thanks,

Mario.

Accepted Solutions (1)

Accepted Solutions (1)

EkanshCapgemini
Active Contributor
0 Kudos

Hi Mario,

You can send this media file directly to the gateway without base64 encoding. The faulty reception at the GW end is because of large file size (so the large base64 string). Please check this reply .

Any particular reason to send it as base64?

Regards,

Ekansh

mario_maisto
Participant
0 Kudos

I got the Base64 solution running. The abap debugger showed the base64 variable shorter than it was, but now i realised, that all the characters were actually still there. So there was no problem uploading the file. I managed to get the download function (from javascript web page) working as well, where I used atob and blob. I tried the solution with documents up to 10mb and there hasn't been any problem so far.

Ekansh - Yes, I tried the more common approach You suggested, with directly sending files with the 'media' type Web-service, but I got lost with coding in the _DPC classes and the base64 solution seemed easier (at that moment ).

Thank You for Your help!

Greetings,
Mario.

Answers (0)