on 05-05-2020 8:15 AM
Hello Experts,
We're trying to consume a ODATA services via ODATA V4 Adapter to fetch PDF content as raw Binary format,but the services is sending some encoding characters(<½Óú¬µ„PÄO“VÅvz„LY•e“5)which is getting formatted as �<������P�O�V�vz�LY�e�5.
We have tried options in groovy to fetch the content as raw format via Reading payload as an java.io.InputStream, stream object:
referred this blog(https://blogs.sap.com/2019/07/15/handling-text-files-in-groovy-script-of-cpi-sap-cloud-platform-integration./) and still receive the same content.
How can we set these parameters in the ODATA Receiver CPI Adapter or in Groovy to extract the UTF-8 format?
Please help to provide your Valuable inputs.
Thank You,
Ezhil.
Hi Ezhilkumar,
Did you already try to read out the content like this?
import com.sap.gateway.ip.core.customdev.util.Message;
import java.util.HashMap;
def Message processData(Message message) {
def body = message.getBody();
def bodyListCsv = body.readLines('windows-1252');
message.setBody(bodyListCsv.join('\n'));
return message;
}
In the following blog post I'm fetching a zip file holding a CSV file. And I'm converting/decoding it to the right format with the grooy script above. Maybe this can help. In case you are reading the content with a different encoding, you can pass it along, to obtain your result in the right format.
Kind regards,
Dries
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.