Hi Thong,
Well, returning the BAE64 content is simple, but on caller's side the html page must decode it and make some coding to show it.
The content URL isn't usable (in my case), because BAW asks user to log in to access that URL.
Anyway, I will return the BASE64 content, and the developer of the caller web page will solve it somehow.
------------------------------
Laszlo
------------------------------
Original Message:
Sent: Wed March 03, 2021 08:24 AM
From: Thong Huynh
Subject: How to transfer file using a webservice?
Hi Laszlo,
You have 2 ways to do it:
- BPM web service to return base64 mime type encoded string. Then whatever consumes this web service will take the base64 and decode it to a file (you can do this with Java easily). Not sure what is your setup at the other end when you say you want it to be downloadable. This isn't up to BPM. You can do whatever with your files
- Or you can use BPM's built in filenet as the document store and use BPM web service to return the file content url instead of the actual file content. I much prefer this way.
Regards
------------------------------
Thong Huynh
Sydney NSW
Original Message:
Sent: Tue March 02, 2021 12:47 PM
From: Andrew Paier
Subject: How to transfer file using a webservice?
Due to how variables are handled in the BPM engine it is not safe to place the binary data of a file in a variable in its raw form. The issue is that some combinations of the potential file content can look like "escape" characters to the engine and cause an error. For this reason all the ECM* data types in the content management toolkit interact with the file as Base64 encoded strings.
So if you want to return a binary file, you will need to get it into the variable encoded in a way that is acceptable (e.g. Base64). If you are working with the ECM components you already have that. If you are working with something else you will need to figure out how to get that encoding done. If you give us more information we can make some recommendations.
Note if it is an ECM file, you can return a URL and let the caller figure out how to download the file from that.
------------------------------
Andrew Paier
Original Message:
Sent: Mon March 01, 2021 02:54 PM
From: Laszlo Kertesz
Subject: How to transfer file using a webservice?
Hi All,
Is it somehow possible to return a file in a BAW webservice as a response?
Thx,
------------------------------
Laszlo
------------------------------